有没有办法异步加载一个iframe

有没有办法异步加载一个iframe

问题描述:

我有一个iframe指向另一个网站的网页。我不希望这阻止页面的其余部分的加载。是有办法asyncrounously加载它?

i have a webpage with an iframe pointing to another website. I dont want this to block the loading of the rest of the page. is there a way to load it asyncrounously?

它不应该阻止。如果你想在主网页,充分第一负载(例如,前iframe中的内容主要页面的图像),那么你就必须使用一些JavaScript来设置iframe的网址,例如<身体的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:...">