<script language="JavaScript">
window.onload=function()
{
document.all("test").height=test.document.body.scrollHeight;
}
</script>
<iframe name="test" src="abc.htm" frameborder="0"  marginheight="0"  marginwidth="0" width="100%" height="0" scrolling="no"> </iframe>

解决方案 »

  1.   

    var  h  =  document.body.scrollHeight;  //刷新时这里取值为零------>var  h  =  iframe.document.body.scrollHeight;
      

  2.   

    var h = document.body.scrollHeight;
    =>
    var h = document.documentElement.scrollHeight;
      

  3.   

    var h = document.documentElement.scrollHeight;
    试过,可是仍旧不行....
      

  4.   

    把以下代码加到引用页面,iframe会自动适应引用页面的高度
    <script language="javascript">
    function f_frameStyleResize(targObj)
    {
    var targWin = targObj.parent.document.all[targObj.name];
    if(targWin != null)
    {
    var HeightValue = targObj.document.body.scrollHeight
    if(HeightValue < 540){HeightValue = 540} //不小于540
    targWin.style.pixelHeight = HeightValue;
    }
    }function f_iframeResize()
    {
    bLoadComplete = true;
    f_frameStyleResize(self);
    }var bLoadComplete = false;
    window.onload = f_iframeResize;
    </script>