获取iframe窗口的 contentWindow 不兼容Chrome ?解决思路
获取iframe窗口的 contentWindow 不兼容Chrome ?
3.html页面:
------解决方案--------------------
+1
------解决方案--------------------
(iframe.contentWindow
------解决方案--------------------
iframe).document
------解决方案--------------------
LZ,对不起.我搞错了。。。不用那样的
如果你的代码没错,你用IIS查看,不要直接在浏览器中找打开页面就可以的!
------解决方案--------------------
安全问题,你用http://这种格式来访问就可以了。
<script type="text/javascript">
function show(){
var iframe=document.getElementById('aa');
var h=iframe.contentWindow.document.body.offsetHeight;
alert(h)
}
</script>
</head>
<body>
<iframe id="aa" src="3.html" frameborder="0" scrolling="no" width="100%" height="200" ></iframe>
<input type="button" value="click" onclick="show()"/>
</body>
</html>
3.html页面:
<body>
test
</body>
为什么Chrome浏览器弹不出 3.html的高度呢? thank everyone!
------解决方案--------------------
+1
------解决方案--------------------
(iframe.contentWindow
------解决方案--------------------
iframe).document
------解决方案--------------------
LZ,对不起.我搞错了。。。不用那样的
如果你的代码没错,你用IIS查看,不要直接在浏览器中找打开页面就可以的!
------解决方案--------------------
安全问题,你用http://这种格式来访问就可以了。