1,父页面调用子页面中的内容 (ifrtest:iframe的id)
DOM方法:
document.getElementById('ifrtest').contentWindow.document;
window.frames["ifrtest"].document
jquery方法:
$(window.frames["iframeSon"].document).find("*");
$("#mainiframe").contents().find("*");$("#subId",document.frames('ifrtest').document)
$(document.getElementById('ifrtest').contentWindow.document
DOM方法:
window.frames["ifrtest"].document
jquery方法:
$(window.frames["iframeSon"].document).find("*");
2,子页面调用父页面中的内容
DOM方法:
window.parent.document
</pre><pre name="code" class="java">jquery方法:
$(window.parent.document).find(“*”)
DOM方法:
</pre><pre name="code" class="java">jquery方法:
$(window.parent.document).find(“*”)