<pre name="code" class="javascript"><pre name="code" class="html"><iframe id="iframe1" name="iframe1" frameborder="0" width="100%" scrolling="no" onLoad="iFrameHeight()"></iframe>
function iFrameHeight() { var ifm= document.getElementById("iframe1"); var subWeb = document.frames ? document.frames["iframe1"].document : ifm.contentDocument; if(ifm != null && subWeb != null) { ifm.height = subWeb.body.scrollHeight; ifm.width = subWeb.body.scrollWidth; } };