未在 IE 中触发 iFrame 的加载事件 [英] Load event for iFrame not fired in IE
本文介绍了未在 IE 中触发 iFrame 的加载事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
为什么 load
事件没有在 iFrame 的 IE 中触发?
Why is the load
event not fired in IE for iFrames?
请看一下这个例子.
在 FF 和 Chrome 中按预期完美运行,但 IE 失败.
Work perfectly as expected in FF and Chrome, but IE fails.
推荐答案
我认为对于 Internet Explorer 中的 iframe,您无法以编程方式设置该事件处理程序 (onload),您需要在标记中指定它.
I think for iframes in Internet Explorer you can't set that event handler (onload) programmatically, you need to specify it in your markup.
类似于:
<iframe id="myFrame" onload="myFunction();"></iframe>
否则 IE 将忽略该函数.
Otherwise IE is just going to ignore the function.
这篇关于未在 IE 中触发 iFrame 的加载事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文