External JavaScript Files and script-Tags

I spent half of the day hunting down a nice issue related to external JavaScript files and a group of `

The block containing the variable declaration never got executed. The reason? Both Firefox and Internet Explorer went straight ahead and parsed the stuff until the ending `` and because of the fact that `

As an experiment I tried declaring the HTML as being XHTML, but even that didn’t help. Or maybe I have been staring at this code for too long.

All those doubts and fears that I’m too stupid for this, they’re all real!

2 Responses to “External JavaScript Files and script-Tags”

  1. metafeather says:

    Funny how these things come along all at once, but the following will be of interest about the underlying behaviour of this:

    Understanding HTML, XML and XHTML: Close your and tags!
    http://webkit.org/blog/?p=68

  2. Yeah, I read about the article a few days after this post on ajaxian.com: http://ajaxian.com/archives/why-doesnt-script-work.
    Doh!

Leave a Reply

You must be logged in to post a comment.