先嚴重差評一下,用這種方法window.parent.document.frames['layui-layer-iframe1']不行!而且frames方法存在瀏覽器不兼容問題(貌似火狐不行)

頁面document明明就拿到的iframe元素

接下來考慮用jquery來拿,親測可行,但是!jquery又怎么拿得到iframe頁面里面的js變量,拿不到的,這個方法等於$(document),拿拿頁面元素還可以。。。
parent.$("#layui-layer-iframe1").contents().find("input[name='applyAppcode']").val(data.app_code);
我們還是老實用js方法拿吧!
拿iframe:window.parent.document.getElementById('layui-layer-iframe1')
拿iframe窗體:window.parent.document.getElementById('layui-layer-iframe1').contentWindow
拿頁面doc:window.parent.document.getElementById('layui-layer-iframe1').contentWindow.document
拿js變量或方法:window.parent.document.getElementById('layui-layer-iframe1').contentWindow.變量/方法
想用jquery拿頁面元素:$(window.parent.document.getElementById('layui-layer-iframe1').contentWindow.document).find("");



