case "edit": var indext= layer.open({ type: 2, title: '产品信息列表', //shadeClose: true, //点击遮罩关闭 shade: 0.8, area: ['70%', '90%'], btn: ['确认', '取消'], //按钮 content: ['/Common/ProductInfo'],//iframe的url no代表禁用滚动条 yes: function (index, layero) { var body = layer.getChildFrame('body', index); //得到子页面层的BODY body.find('#hidValue').val(index); //将本层的窗口索引传给子页面层的hidValue中 }, btn2: function () { parent.layer.close(indext); }, success: function (layero, index) { layero.find('.layui-layer-btn').css('text-align', 'center') console.info(index); var body = layer.getChildFrame('body', index); var iframeWin = window[layero.find('iframe')[0]['name']]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method(); console.log(body.html()) //得到iframe页的body内容 body.find('#ItemCode').val('Hi,我是从父页来的') }, end: function () { //layer.msg('关闭页面'); } }); break;