easyui_dialog怎么获取嵌入页面的form表单数据

新手上路,请多包涵

打开dialog和调用子页面的js代码。

    function openAdd() {
        $("#dialog").dialog("open");
    }


    $("#dialog").dialog({
        title: 'your title',
        modal: true,
        content: "<iframe scrolling='auto' frameborder='0' src='/app01/indoortest_add/' style='width:100%; height:100%; display:block;'></iframe>",
    buttons: [{
                    text:'Ok',
                    iconCls:'icon-ok',
                    handler:function(){
                        alert(“ok”)
                    }
                },{
                    text:'Cancel',
                    handler:function(){
                        alert('cancel');;
                    }
                }]

    });
阅读 2.8k
1 个回答

获取iframe

document.getElementById('iframe_name');
window.frames["iframe的name值"]

iframe得到外部数据

let value = window.parent.document;//父的文档
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进