IE7, IE8 Beta2… meet <object/>

Why is it that IE7 and IE8 Beta 2 still can’t quit get the <object/> tag correct? When using Javascript to “dynamically” add object tags to the interface my experience, bad luck, and bouts of pain teach me that using the DOM API just doesn’t cut it. Well, to be fair the following functions don’t cut it:

  • document.createElement
  • document.createAttribute
  • [DOMElement].setAttribute(key, value)
  • [DOMElement].setAttributeNode([DOMAttribute])

For any and all other “dynamic” HTML modifications the above functions work great! But if I use them to embed Flash or Silverlight movies it just tanks. Instead you have to construct ugly strings that represent the HTML you want and use [DOMElement].innerHTML. When you do this, suddenly the .swf/.xap loads and all is well.

Why oh why?

And for anyone who cares, following file does a decent job of HTML generation within Javascript… except for IE and the <object/> tag…. and input of type radio (WTF!).

http://cowarthill.com/blog/wp-content/uploads/2008/11/html_obj.js

This entry was written by MET , posted on Tuesday November 25 2008at 08:11 pm , filed under programming and tagged , , , . Bookmark the permalink . Post a comment below or leave a trackback: Trackback URL.

Leave a Reply

You must be logged in to post a comment.