本文介绍了加载iframe内容的过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
具有以下代码:
Having following code
<iframe id="myframe" src="..."></iframe>
<script>
document.getElementById('myframe').onload = function() {
alert('myframe is loaded');
};
</script>
我想知道浏览器如何处理iframe?它是否在单独的线程中加载iframe内容?如果是这样,它与主线程同步运行?
i wonder how does the browser processes an iframes? Does it load the iframe content in the separate thread? If so is it run synchronously with the main thread?
推荐答案
iframe正在加载与主网站的同步。如果您想首先加载主站点的内容
The iframe is loading sync with the main website. If you want to load the content of the main site first
<body onload="javascript:...">
这篇关于加载iframe内容的过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!