當前位置:生活全書館 >

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/dianzi/58rwp0.html