//iframe高度自适应 function IFrameReSize(iframename) { var pTar = document.getElementById(iframename); if (pTar) { //ff if (pTar.contentDocument && pTar.contentDocument.body.offsetHeight) { pTar.height = pTar.contentDocument.body.offsetHeight; } //ie e
javascript获取iframe框架中,加载的页面document对象 因为浏览器安全限制,对跨域访问的页面,其document对象无法读取.设置属性 function getDocument(iframe) { var Doc; try{ Doc = iframe.contentWindow.document;// For IE5.5 and IE6 }
1.父页面添加: <script> function testBtn(){ var reshSrc = document.getElementById('myFrame').src; var iframe1=document.getElementById("mainframe"); iframe1.src = reshSrc;//需要给主框架刷新才可以 } </script> <iframe name="mainframe" i