主页
<td id=iHeight>框架页
<body onload="parent.document.all.iHeight.height=this.document.body.scrollHeight+10;">

解决方案 »

  1.   

    子页面加上<body onload="window.resizeTo(document.body.scrollWidth+10,document.body.scrollHeight+10);">
    这句话,有的时候可以显示,怎么有的时候是提示“拒绝访问”,有没有更好的法子,(子页面、主页面我都可以修改)
      

  2.   

    to  FEB15(83年的矿泉水) :提示拒绝访问。不过还是谢谢你
      

  3.   

    onload="parent.document.all.iHeight.height=this.document.body.scrollHeight+10;" 哦
    不是你的
    onload="window.resizeTo(document.body.scrollWidth+10,document.body.scrollHeight+10);"父页插入iframe的表格的<td id=iHeight>
      

  4.   

    to  FEB15(83年的矿泉水) 
    你的是远程调用吗?
    我的父页面:
    <table width=500 border=1>
    <tr><td id=iHeight><iframe  width="100%" scrolling="NO" frameborder=0 name=ifs id=ifs src="http://远程地址/iframe1.html">
    </iframe></td></tr></table>子页面:
    <body onload="parent.document.all.iHeight.height=this.document.body.scrollHeight+10;">
    <table width="294" border="0" cellspacing="0" cellpadding="0">可是不行啊!
      

  5.   

    iframe 里面 加入 height=100% 看看。
      

  6.   

    不是iframe的问题,是子页面没有操作父页面的权利。
    行:14
    字符:1
    错误:拒绝访问。
    代码:0
    URL: http://远程地址/iframe1.html
      

  7.   

    <script  language=javascript>  
       function  iframeAutoFit() 
       {  
           if(self!=top  &&  window.name=="mainFrame") 
           {  
               var  iframe  =  parent.document.getElementById(window.name);  
               if(iframe)  
               {  
                   iframe.parentNode.style.height  =  iframe.style.height;  
                   iframe.style.height  =  10;  
                   var  h  =  document.body.scrollHeight;  
                   var  minimalHeight  = 423;  
                   h  =  h<minimalHeight  ?  minimalHeight  :  h;  
                   if(window.navigator.appName  ==  "Microsoft  Internet  Explorer"  
                       &&  iframe.frameBorder=="1")  h  +=  4;  
                   iframe.parentNode.style.height  =  iframe.style.height  =  h;  
               }  
               else  alert("Iframe's  id  unequal  to  iframe's  name!");  
           }  
       }  
       if(document.attachEvent)  
       {
        window.attachEvent("onload",  iframeAutoFit);  
       }
       else  window.addEventListener('load',  iframeAutoFit,  false);  
       </script>