Regression: Encoding of Script templates in IE9 document mode - by Thor Larholm

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.


ID 549840 Comments
Status Closed Workarounds
Type Bug Repros 2
Opened 4/8/2010 10:48:08 PM
Access Restriction Public

Description

Script templates are an important technology use that was also highlighted during the IE9 Keynote at MIX by use of the jQuery template contributions from Microsoft.

An example of a script template:

<script type="text/html" id="tpl-example">
<div> foo </div>
</script>


There is a functionality regression in IE9 Document Mode, where the script template contents are HTML encoded when read through its innerHTML property.

Example usage code:

<script type="text/javascript">
alert(document.getElementById("tpl-example").innerHTML);
</script>

In IE9 Document Mode, the alert will show "& lt;div& gt; foo & lt;/div& gt;".

In IE8 Document Mode, and all other document modes, the alert will show "<div> foo </div>".

This is contrary to the behavior of IE5-IE8, as well as all other browsers.

This impacts script functionality in major web applications.

IE9 Document Mode can be forced by the site developer by using an HTML5 DTD, such as

<!DOCTYPE html>
Sign in to post a comment.
Posted by Adam [MSFT] on 6/29/2010 at 4:51 PM
Thank you for your feedback.

This issue was resolved in the IE 9 Platform Preview Build released on 6/23/2010. Please verify and file a new bug if the problem persists.

Best regards,

The IE Team
Posted by Adam [MSFT] on 4/22/2010 at 6:30 PM
Thank you for your feedback. We were able to reproduce the issue and are investigating this.

Best regards,

The IE Team
Posted by Adam [MSFT] on 4/22/2010 at 6:30 PM
Thank you for your feedback. We were able to reproduce the issue and are investigating this.

Best regards,

The IE Team