views:

345

answers:

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!

A: 

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.

Plugawy
Yep, I'm aware you have to bind your event handlers after the <object> exists. This doesn't work though, if the object doesn't send any events! When I say window.onload, I mean window.onload - which ISN'T the same thing as eg, jQuery's ready. You can instantiate QuickTime up until window.onload and expect it to send events, but not afterwards.
stephband
A: 

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.

stephband