<script>
   function ifr_h()
   {
   var frameWin = document.getElementById("frameWin");
   var frameBox = document.getElementById("frameBox");
   var newHeight;
   
   if (frameWin.Document){
  newHeight = frameWin.Document.body.scrollHeight + 20 + "px";
   }else{
  newHeight = frameWin.contentDocument.body.scrollHeight+ 20 + "px";
   }
   frameWin.style.height = newHeight;
   frameBox.style.height = newHeight;
 }  
    </script>
  <div style="border:0px" id="frameBox">
   <iframe id="frameWin" src="{$PHPCMS[siteurl]}comment/?keyid={$keyid}&verify={$verify}" name="opWin" style="width:100%; height:100%;bgColor:transparent;" frameborder="0" scrolling="no" onload="ifr_h()"></iframe>
  </div>
这是一段最郁闷的JS脚本,功能是处理iframe自适应高度,有的页面好用,有的页面不好用,愁死我了,各位帮忙看看吧。