我的网站中有两个嵌套的iframe,一个在
中首先是iframe - content.html
content.html
<body>
<iframe id="iframe" src="test.html" frameborder="0" ></iframe>
<script type="text/javascript">
var h = document.documentElement.clientHeight;
document.getElementById("iframe").setAttribute("style","height:"+h+"px !important;width:100%");
window.onresize = function(event) {
var h = window.innerHeight;
document.getElementById("iframe").setAttribute("style","height:"+h+"px !important;width:100%");
};
</script>
的test.html
<body>
<iframe id="iframe" src="hello.html" frameborder="0" ></iframe>
<script type="text/javascript">
var h = document.documentElement.clientHeight;
document.getElementById("iframe").setAttribute("style","height:"+h+"px !important;width:100%");
window.onresize = function(event) {
var h = window.innerHeight;
document.getElementById("iframe").setAttribute("style","height:"+h+"px !important;width:100%");
};
</script>
当我在Iphone(IOS 9,10)浏览器Safari浏览器中打开content.html时,网站无法正常加载并崩溃。
如果有人有解决方案而不是让我知道。