什么时候IFRAME onload事件触发? [英] Exactly when does an IFRAME onload event fire?

查看:804
本文介绍了什么时候IFRAME onload事件触发?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

IFRAME的onload事件在HTML完全下载时触发​​,或仅在所有相关元素加载时才触发? (css / js / img)

Does the IFRAME's onload event fire when the HTML has fully downloaded, or only when all dependent elements load as well? (css/js/img)

推荐答案

后者:< body onload = 只有当所有依赖元素(css / js / img)都已加载时才会触发。

The latter: <body onload= fires only when all dependent elements (css/js/img) have been load as well.

如果要在加载HTML时运行JavaScript代码,在HTML末尾执行此操作:

If you want to run JavaScript code when the HTML has been loaded, do this at the end of your HTML:

<script>alert('HTML loaded.')</script></body></html>

以下是相关电子邮件线程了解加载准备之间的区别( jQuery同时支持)。

Here is a relevant e-mail thread about the difference between load and ready (jQuery supports both).

这篇关于什么时候IFRAME onload事件触发?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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