JavaScript is Displaying instead of Running in IE9
March 5, 2013
This was a really weird thing I ran across the other day while I was working on a site. It worked fine in IE8, IE7, Chrome, Safari, and Firefox. But in IE9, the entire JavaScript text was being displayed at the top of the page. The weird thing was that JavaScript was enabled, so it wasn’t that. Then I tried adding a few different meta tags at the top, but those did not fix the issue.
It ended up being a conditional IE If statement like this:
So if you run into any issues with IE9 not running, but instead displaying JavaScript, try removing the conditional IE code or at least making it
<!--[if lt IE 8]>
instead.