是否有HTML的“对象”的跨浏览器标准载入事件标签? [英] Is there a cross-browser standard on-load event for HTML's "object" tag?

查看:87
本文介绍了是否有HTML的“对象”的跨浏览器标准载入事件标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道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屋!

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