本文介绍了加载嵌入式元素的事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果我对嵌入式对象执行在线 onload
事件,那似乎可行,但是我似乎无法通过 addEventListener
.这是预期的吗?
If I do an online onload
event for embedded objects, that seems to work but I can't seem to get the load
event working through addEventListener
. Is this expected?
推荐答案
可能,但是可能取决于浏览器.
Probably, but it may be browser dependent.
窗口,图像和iframe通过addEventListener和attachEvent定义其加载事件,但其他加载事件是特定于浏览器的.
windows and images and iframes define their load events with addEventListener and attachEvent, but other load events are browser specific.
例如,脚本或链接元素的onload不会在IE中附加.
A script or link element's onload doesn't attach in IE, for instance.
这篇关于加载嵌入式元素的事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!