xhtml Script Tag in Internet Explorer
This one caused me a headache for a bit, trying to figure out what was wrong. Don’t use something like this in internet explorer…
<script type="text/javascript" src="script.js" />
For some reason, ie doesn’t understand the xhtml tag properly, and up goes your page in a puff of smoke - the source looks fine, and validates, but explorer renders a blank page. For xhtml compliance, just use:
<script type="text/javascript" src="script.js"></script>
…and it works fine.

July 17th, 2005 at 00:21
Thanks! Life saver!
http://twiggyframe.marquettecollective.com
June 13th, 2007 at 22:06
One more thing to remember with this is that if you are using XSLT to generate your XHTML, then the XSLT processor is likely to change from
to
you can fix this with the following
// IE BUG FIX– Hopefully this will save someone some time
June 13th, 2007 at 22:11
well, the code that I tried to show in my comment has been stripped out…. so I’ll try again
If you are generating your XHTML from the result of an XSL transformation, then the XSLT processor is likely to take your working script tags, and optimise them to the non working script tags.
This problem can be avoided by place a JavaScript comment in between the opening script tag and the closing one. For my comment I’m just using // IE BUG FIX.
– Hope that makes sense, and helps someone