方法1:在iframe中加入name属性。然后加上οnlοad="this.height=webb.document.body.scrollHeight+20"。例如:
<iframe src="huizAdd.jsp" width="100%" height="100%" scrolling="no" FrameBorder="0" id="webb" name="webb" οnlοad="this.height=webb.document.body.scrollHeight+20"></iframe>
方法2:在被iframe调用的文件</body>之后加入上面这段即可。
<script language="javascript">
if (window.parent.length>0){window.parent.document.all.webb.style.height=document.body.scrollHeight;}
</script>
其中webb是iframe的name。