呵呵, 一样的代码, 我这里就从没有出现过类似的问题function changeIframeHeight()  //自动改变 Iframe 的高度
{
   if(top != self)
   {
      window.parent.document.getElementById(self.name).height = document.body.scrollHeight;
   } 
}
function window.onload()
{
   changeIframeHeight(); //改变 Iframe 高
}

解决方案 »

  1.   

    <script>
    if(self.name!="yunshui")
      {self.location.reload()
       self.name="yunshui"
      }
      

  2.   

    可能是你在页面还没有加载完成之前,也就是说页面还不知道body.scrollHeight的时候使用了这个函数,在你的</body>前面添加改变iframe高度的代码
    <script>
    if (self.location!=top.location)
     {
         parent.window.document.all.iframe1.height=document.body.scrollHeight +20;
     }
    </script>
    </body>这样试试
      

  3.   

    我觉得各位说的有道理,不知道为什么不起作用。我别的页面也没有这问题。
    就是从servlet返回的xml用xsl(jsp扩展名)处理之后有这个问题。