Re: Reinitializing OBJECT and EMBED - data and type changes

Michael A. Puls II wrote:
> I assume the paragraph means: "If data or type is added or removed (in
> any way) or modified (in any way, even to the same exact value)

I would hope that the "even to the same exact value" part is not actually the 
intent.

> var obj = document.getElementsByTagName("object")[0];
> obj.addEventListener("DOMAttrModified", function(e) {

Note that setting an attribute to the value it already has doesn't fire 
DOMAttrModified in at least some UAs, so this pseudo-code doesn't quite match 
your prose description.

> Opera and Firefox currently support reinitializing an object when you
> change the type. However, it only works in certain cases.  Switching
> an object to a Java applet from the Windows media plugin is an example
> of one situation that doesn't work.

Assuming we're talking about Firefox 3 (which handles this very differently from 
Firefox 2; I don't even remember what Firefox 2 does, exactly), type attribute 
changes do not cause any reinitialization.  This can be changed, of course.

-Boris

Received on Wednesday, 23 April 2008 17:50:38 UTC