那第二个页面得是你在第一个页面中window.open的<html>
<script>
function init() {
var mywin = window.open("about:blank", "");
alert(mywin.document.body.clientWidth);
}
window.onload = init;
</script>
</html>
<script>
function init() {
var mywin = window.open("about:blank", "");
alert(mywin.document.body.clientWidth);
}
window.onload = init;
</script>
</html>
<table width=400 height=200>
<tr>
<td>
测试测试试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试
</td>
<tr>
</table>
<script>
alert("本页页面的宽和高[不是窗口的宽高]分别是:"+document.all.xh.scrollWidth+","+document.all.xh.scrollHeight)
</script>
</body>
<iframe id="page1" name ="page1" src="1.htm" frameborder=0 scrolling=no width='100%' height=???></iframe>
<iframe id='page2' name='page2' src="2.htm" frameborder=0 scrolling=no width='100%' height=???></iframe>
现在我希望页面main.htm中所显示出来的1.htm和2.htm都是整页显示,请问这个高度应该填什么,还有在页面1.htm和2.htm中不能有任何的程序.
main.htm
==============================================================================
<HTML>
<iframe id ="page1" src="1.htm" frameborder=0 scrolling=no width='100%' height=0></iframe>
<iframe id='page2' name='page2' src="2.htm" frameborder=0 scrolling=no width='100%' height=0></iframe>
</HTML>
1.htm
==============================================================================
<HTML>
<body topmargin=0 bottommargin=0 marginheight=0 onload="parent.document.all.page1.Height=document.body.scrollHeight">
<table>
<tr>
<td>这是页面1测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测
</td>
</tr>
</table>
</body>
</HTML>
2.htm
==============================================================================
<HTML>
<body topmargin=0 onload="parent.document.all.page2.Height=self.document.body.scrollHeight">
<table>
<tr>
<td>这是页面2测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试
</td>
</tr>
</table>
</HTML>