当前位置:生活全书馆 >

IT科技

> open传参数到子页面 layer

open传参数到子页面 layer

页面传参给子页面(iframe页面):

代码:

var index = layer.open({

title: '编辑',

type: 1,

shade: 0.2,

maxmin: true,

shadeClose: true,

area: [openWH[0] + 'px', openWH[1] + 'px'],

offset: [openWH[2] + 'px', openWH[3] + 'px'],

layer.open传参数到子页面

content: content, //这里是iframe页面的路由

success: function(layero, index){

var body=layer.getChildFrame('body',index);

var fileId = body.contents().find("#fileId");

$(fileId.selector).val(data.id);

}

});

layer.open传参数到子页面 第2张

子页面

<input type="hidden" name="id" id="fileId"  placeholder="文件id" value=""

 class="layui-input">

  • 文章版权属于文章作者所有,转载请注明 https://shqsg.com/zh-hans/dianzi/58rwp0.html