2

I have a specific question about instantiating a QuickTime object in Internet Explorer.

QuickTime in IE uses an <object> as a 'behaviour' template in order to enable DOM events. The behaviour <object> is referenced from the QuickTime plugin instance with IE's behavior style: style="behavior: url(#id_of_behavior_object)".

This works great for all QuickTime <object> instances declared before window.onload, but QuickTime <object> instances inserted into the DOM after that do not pick up the DOM events behaviour.

I do not know exactly how behaviour styles work and what I've read so far hasn't made me any the wiser. Are behaviours called on elements that reference them, only on page load, and therefore can't be picked up later?

Are there any methods for enabling DOM events from QuickTime objects inserted after page load?


Just so you know - I've tried various methods of DOM insertion - innerHTML, createElement, and calling iframes with their own html page containing the necessary objects. None of these work for enabling DOM events on insertion after page load.

Cheers!


What you need is a custom event fired once you loaded your elements. Obviously event handlers which you assign during window.onload/document.ready/dom:loaded (whatever you call it - it depends on the library/framework) won't work because the elements which you are trying to use don't exist yet.

If you use some kind of ajax call, just attach the observing method in your onSuccess handler.

4

2 回答 2

1

This question has been up here for some time, and I did quite a lot of hacking to try and make it work but never found a way, so I have to conclude that the answer is:

No.

于 2010-10-05T22:36:31.140 回答
0

您需要的是加载元素后触发的自定义事件。显然,您在 window.onload/document.ready/dom:loaded 期间分配的事件处理程序(无论您如何称呼它 - 它取决于库/框架)将不起作用,因为您尝试使用的元素尚不存在.

如果您使用某种 ajax 调用,只需在 onSuccess 处理程序中附加观察方法。

于 2009-08-26T21:47:16.487 回答