是否有HTML的“对象”的跨浏览器标准载入事件标签? [英] Is there a cross-browser standard on-load event for HTML's "object" tag?
问题描述
我知道IE支持对象
标签上的 onreadystatechange
属性,但这似乎不成为一种标准方式,因此所有其他浏览器都不支持它。
更新:为了澄清,我不是在寻找DOM Load事件,我正在寻找加载事件的对象
标签本身(例如,一个对象
标签嵌入PDF文件到页面中)
在某种程度上,我正在寻找类似于 img
的 onload
c $ c> c c> c c c >解决方案
在最新版本的Firefox,Chrome和Opera(我刚刚测试过)中,< object onload>
。
另外,document.createElement('object')中的表达式'onload'的计算结果为<$ c Chrome和Opera中的$ c> true
自然地,Firefox是一个例外,因为这样的事件支持检查通常不起作用。 kangax描述了跨浏览器事件支持检测的 http://perfectionkills.com/detecting-event-support-没有浏览器嗅探/
I am aware that IE supports the onreadystatechange
attribute on the object
tag, but this doesn't seem to be a standard way thus all other browsers do not support it.
Update: To clarify, I am not looking for the DOM Load event, I am looking for the load event of the object
tag itself(e.g. an object
tag embedding a PDF file into a page).
In a way, I am looking for something similar to img
's onload
event /complete
attribute for the object
tag.
The <object onload>
attribute works well in latest versions of Firefox, Chrome and Opera (I've just tested it).
Also, the expression 'onload' in document.createElement('object')
evaluates to true
in Chrome and Opera; naturally, Firefox is an exception because such event support check doesn't work there generally. kangax describes cross-browser event support detection at http://perfectionkills.com/detecting-event-support-without-browser-sniffing/
这篇关于是否有HTML的“对象”的跨浏览器标准载入事件标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!