是什么触发了 ie 中对象标签的 onerror 事件处理程序?
我们一直在对一些嵌入式 Flash 小部件进行一些测试。
虽然我知道 onerror 事件,当附加到 对象标签 时,跨浏览器不太友好,但我们为 Internet Explorer 用户调用了这个处理程序。
虽然我非常确定当 swf 无法加载时(如 404、410、网络错误等)会调用此处理程序,但在其他情况下是否会调用它?
由于这些小部件不是我们自己的,是否可以从嵌入的 Flash 文件中“抛出”onerror 事件?如果是这样,这可能就是我们看到这种情况的原因。
我想我也应该把这个也扔进去,是否有可能获得任何额外的信息来说明是什么导致 onerror 事件在被调用时被调用?
总而言之,我们正在寻找的是了解天气情况,可以安全地假设如果从对象标记触发 onerror 事件,则该事件被触发是因为 swf 未成功加载,因此我们可以尝试从另一个网址。是的,如果由于其他原因触发了 onerror 然后 swf 无法加载,我们只是不想尝试重新加载 swf。
一些附加信息:
我们正在使用嵌入 flash 的 flash satay 方法。并简单地将 onerror 添加到对象标记,如下所示:
<object .... onerror="ourAjaxLogFunction()">
一如既往,谢谢您。
we have been doing some testing on some embeded flash widgets.
while i know the onerror event, when attached to a object tag is not very cross browser friendly, we are getting this handler called quite a bit for internet explorer users.
while i am quite sure this handler will be called when the swf cannot be loaded (as in, 404, 410, network error, etc), is it called in any other circumstances?
as these widgets are not our own, is it possible to 'throw' an onerror event from within the embeded flash file? if so, this could be why we are seeing this.
i guess i should throw this in as well, is it possible to get any additional information as to what caused the onerror event to be called when it is called?
to summarize, what we are looking for is to know weather it is safe to assume that IF an onerror event is fired from an object tag, that it was fired because the swf did not load successfully, and thus we can attempt to load it from another url. yea, we just don't want to try reloading the swf if onerror was fired for some OTHER reason then the swf failing to load.
some additional information:
we are using the flash satay method of embeding flash. and simply adding the onerror to the object tag, as follows:
<object .... onerror="ourAjaxLogFunction()">
as always, thank you kindly.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
onerror 的文档说(强调我的):
也许您的 Flash 内容正在尝试跨越某种安全边界。如果是这种情况,尝试从其他来源重新加载它不会有帮助。我建议您对传递给处理程序的错误消息进行进一步调查。
The documentation for
onerror
says (emphasis mine):Maybe your Flash content is trying to cross a security boundary of some kind. If that's the case, trying to reload it from another source won't help things. I'd suggest you perform further investigations on the error messages passed to your handler.