[英]How to start loading an iframe before the DOM is loaded
I have a question that is the oppsite of this: load an iframe asynchronously . 我有一个与此相对的问题: 异步加载iframe 。 I need to start loading the
iframe
the moment the browser starts loading the page, and not after the DOM has finished loading. 我需要从浏览器开始加载页面的那一刻开始加载
iframe
,而不是在DOM完成加载之后开始。
How can I force the load of the iframe
before the DOM is loaded? 如何在加载DOM之前强制
iframe
加载? Before the document.ready
event? 在
document.ready
事件之前?
I tried using an UpdatePanel
around the iframe that starts an async postback, but I get a lot of javascript exception that crash the browser. 我尝试在iframe周围使用
UpdatePanel
来启动异步回发,但是我遇到了很多JavaScript异常,导致浏览器崩溃。
您可以让HTML仅包含IFRAME,并让IFRAME拥有onload事件,该事件会将HTML的其余部分注入到DOM中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.