有没有办法异步加载一个iframe [英] is there a way to load an iframe asynchronously

查看:412
本文介绍了有没有办法异步加载一个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:...">

这篇关于有没有办法异步加载一个iframe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆