异步加载 iframe [英] Load an iframe asynchronously
本文介绍了异步加载 iframe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个网页,其中 指向另一个网站.我不希望这会阻止页面其余部分的加载.有没有办法异步加载它?
I have a webpage with an <iframe>
pointing to another website. I don't want this to block the loading of the rest of the page. Is there a way to load it asyncrounously?
推荐答案
它不应该阻塞.如果您希望主页首先完全加载(例如,在 iframe 内容之前的主页图像),那么您必须使用一些 javascript 来设置 iframe 的 url,例如 <body onload="javascript:...">
It shouldn't block. If you want the main page to fully load first (eg, main page's images before iframe content) then you'll have to use a bit of javascript to set the url of the iframe, like <body onload="javascript:...">
这篇关于异步加载 iframe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文