Monday, 18 April 2011

IE9 and MIME Type Handling

I upgraded my Internet Explorer from v8 to v9 a couple of weeks ago. I immediately discovered that the SyntaxHighlighterI use on my Blog is no longer working. I turned on the console view (by pressing F12) of IE9 and it showed that the Javascript file of SyntaxHighlighter loaded from my Google Site is actually named syntaxhighlighter2.txt; however, the type of the link was text/javascript.

This mismatch between the file name extension and the specified MIME type upsets IE9, so it refuses to load my SyntaxHighlighter script. I tried to turn off the MIME handling feature in IE9 by changing the Windows registry following instructions in the following articles:

None worked.

So I took the simple approach – change my SyntaxHighlighter file extension from .txt to .js – and it worked.