open傳引數到子頁面 layer
- IT科技
- 關注:1.21W次
父頁面傳參給子頁面(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'],
content: content, //這裡是iframe頁面的路由
success: function(layero, index){
var body=layer.getChildFrame('body',index);
var fileId = body.contents().find("#fileId");
$(fileId.selector).val(data.id);
}
});
子頁面
<input type="hidden" name="id" id="fileId" placeholder="檔案id" value=""
class="layui-input">
- 文章版權屬於文章作者所有,轉載請註明 https://shqsg.com/dianzi/58rwp0.html