tags:

views:

58

answers:

1

This is really weird.

Here's a simple markup

<div id="div1">
    <object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="640px" height="480px">
    </object>
</div>

and executing alert(document.getElementById("div1").innerHTML); shows me

<OBJECT type=application/x-silverlight-2 height=480 width=640 data=data:application/x-oleobject;base64,QfXq3+HzJEysrJnDBxUISgAIAAAlQgAAnDEAAAAAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA></OBJECT>

Firefox or google chrome shows me correct markup. Only IE(tested on IE7) shows me above strange markup.

+1  A: 

Chrome and Firefox return the html supplied by the original document in this case.

IE never does that, once it has parsed HTML and create the DOM it discards the original document text. When you ask for innerHTML it constructs a new HTML string by analysing the DOM nodes and attributes held within the element.

At times this means you will see the result of mutations made by the parser and other components of IE. In this case components in IE responsible for handling sited objects and possibly Silverlight itself have mutated the <object> attributes.

AnthonyWJones