web dev Archive

xhtml Script Tag in Internet Explorer

January 17th, 2005

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.

  • Search
  • You are currently browsing the matthewcarroll.ca web dev archive.

  • Meta

  • Old Browser

    It seems you are using an old web browser (e.g. Internet Explorer 5 or below). This is a security risk to you, since Microsoft no longer releases updates for old versions of Internet Explorer. Also, note that this site is designed to modern internet standards, and the layout may appear strange or plain in older browsers. All the content is still accessible to you, but I strongly recommend you upgrade to a modern, safe, standards-complient browser, such as Firefox. For more information on getting the best experience surfing the web, see browsehappy.com.