layui layer 父层向页面层(iframe)传值

父层代码

  layer.open({
                    type: 2,
                    title:'供应商信息登记',
                    anim:2,
                    maxmin:1,
                    content: '/inGoodPage/upLayer',
                    area:['420px','500px'],
                    //resize:true,允许拖拽大小
                    success: function(layero){
                        							//此id为页面层input标签id
                        var jquerySendHelloButton = $("#sid", layero.find("iframe")[0].contentWindow.document);
                        									//要传的值
                        jquerySendHelloButton.attr("value", data.suppliersId );
                    }
                })

重点:id一定要对应不然无法传值
页面层(iframe)代码

//传值直接就传入此标签中
<input type="text"   id="sid" >
发布了45 篇原创文章 · 获赞 47 · 访问量 1690

猜你喜欢

转载自blog.csdn.net/qq_44784185/article/details/104179886