IE9 preview fails to manage <script type="text/html"> - by jpvincent

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 549601 Comments
Status Closed Workarounds
Type Bug Repros 1
Opened 4/8/2010 5:08:09 AM
Access Restriction Public


I'm using a JavaScript templating engine where the HTML parts are stored within the page between special <script> tags. Eg:

<script type="text/html" id="tpl-example">
<div> [DYNAMIC_CONTENT] </div>

with IE9 preview, the content of this special type of script is simply displayed in the page and the templating engine is not able to retrieve the content of it

normal behaviour should be :
- IE ignores <script> tag with unknow type
- but content of it is still accessible (document.getElementById('tpl-example').innerHTML still gives the string, non interpretated)

By the way, I remember that 2 years ago, I had exactly the same problem with IE8 beta. Fortunately when the finale release came out, the behaviour was back to normal
Sign in to post a comment.
Posted by Microsoft on 11/16/2010 at 11:53 AM
Thank you for your feedback.

This issue was resolved in Internet Explorer 9 Platform Preview Build 3 released on 6/23/2010. Please verify the change and file a new feedback (or reactivate the existing one) if the problem persists.

Best regards,

The Internet Explorer Team
Posted by jpvincent on 6/24/2010 at 4:23 AM
I tested on the latest Preview 3 of IE9, and now my template engine works correctly!

thanks, this bug is closable for me
Posted by Microsoft on 4/22/2010 at 4:59 PM
Thank you for your feedback. We were able to reproduce the issue and are investigating this.

Best regards,

The IE Team
Posted by jpvincent on 4/20/2010 at 12:35 AM
OK, I made a page to illustrate my problem and saw that the issue is not exactly the one I thought it was. See this public page :

The template engine manages to retrieve the string within <script type="text/html" id="mytemplate"> and the outputting string is correct, but there is a problem when inserting the string into the DOM via .innerHTML : it seems to be not interpretated as HTML.
Actually, that works :
document.getElementById('insert-here').innerHTML = '<h1 style="color:green">Templating works</h1>';
but the output of the templating engine doesn't whereas it's a string type.

I must probably change or adapt something within the templating engine itself, but I can't even guess why IE9 preview behaves this way
Posted by Thor Larholm on 4/8/2010 at 10:33 PM
Script templates are quite an important technology use case, which was even highlighted on stage during the IE9 Keynote at Microsofts MIX conference.
Posted by Thor Larholm on 4/8/2010 at 10:32 PM
I am unable to reproduce this in IE9 Developer Preview 1.9.7745.6019.

The script template is not displayed in the page, and my script can read its contents.

The test case I am using is as follows:


<script type="text/html" id="tpl-example">
<div> [DYNAMIC_CONTENT] </div>

<script type="text/javascript">


Judging from the screenshot, this seems to be an error in the timeofmylife script.

I am unable to debug the timeofmylife script as it requires a login.