[javascript]var adjustIframe = 함수 (id) { var iframe = document.getElementById(id) var idoc = iframe.contentWindow && iframe.contentWindow.문서 || iframe.contentDocument; var 콜백 = 함수 ()> { var iheight = 수학.max(idoc.< ;span style="color:rgb(102,0,102)">body.scrollHeight, idoc.documentElement.scrollHeight) //取得其高 iframe.style.height = iheight + "px"; } if (iframe.attachEvent) { iframe.attachEvent("onload", callback); } else { iframe.onload = callback } } [javascript]HTML代码如下所示: 使用代码:window.onload = 기능(< ;/span>){ adjustIframe("js_sub_web"< ;span style="color:rgb(0,153,0)">); }