1.一种方法iframe中每个文件控制parent的高度
<iframe src="about:<body onload='parent.document.all.demo.height=document.body.scrollHeight+20'><div style=height:1000>" id=demo></iframe>
2.一种是主页面用setInterval
<script>setInterval("document.all.demo.height=demo.document.body.scrollHeight+20")</script>

解决方案 »

  1.   

    感谢 qiushuiwuhen(秋水无恨) 
    使用第一种方法将问题解决
    个人认为第二个方法更好,可惜对jsp页面出错,不知可有解决办法
      

  2.   

    第一种可以,第二种应该也可以,加上
    <script>setInterval("try{document.all.demo.height=demo.document.body.scrollHeight+20}catch(e){}")</script>
      

  3.   

    试过的,父不能访问不同域名的子iframe或frame 。没有权限的.
    try this:
    <iframe src="http://google.wxonline.net/" id=demo></iframe>
    <script>setInterval("try{document.all.demo.height=demo.document.body.scrollHeight+20}catch(e){}")</script>
      

  4.   

    同意..
    建议去MSDN看看关于IE的frame跨域安全性主题.
    有办法绕过,但不适合在website中实现.
      

  5.   

    楼主的问题应该是这样的:
    如果你套用的iframe 是同域的,那你可以用上面的两种方法.
    或者:
    用behavior:<HTML>
    <HEAD>
    <TITLE>DOWNLOAD Behavior Sample</TITLE>
    <style>
    .pickFrag {behavior:url(download.htc) url(#default#download)}
    </style>
    <BODY><div sURL='frag.htm' class=pickFrag></div>
    </body>
    </html>download.htc:<PUBLIC:COMPONENT>
    <PROPERTY NAME="content" />
    <PUBLIC:ATTACH EVENT="onload" FOR="window" ONEVENT="setcontent()"  />
    <script language="jscript">
    function setcontent(s){
    sURL = this.sURL;
    this.startDownload(sURL, onDownloadDone);
    }
    function onDownloadDone(s){
    this.innerHTML = s;
    }
    </script>
    </PUBLIC:COMPONENT>参考:
    http://www.roulong.com/draco/skill/download_frag_htc.html