Re: Bizarre <script> tag spec

David Perrell (davidp@earthlink.net)
Mon, 14 Jul 1997 00:20:20 -0700


Message-Id: <199707140721.AAA29681@iceland.it.earthlink.net>
From: "David Perrell" <davidp@earthlink.net>
To: <www-html@w3.org>
Subject: Re: Bizarre <script> tag spec
Date: Mon, 14 Jul 1997 00:20:20 -0700

jwp@checfs1.ucsd.edu wrote:
> thus, this is illegal:
> 
>     >      <SCRIPT type="text/javascript">
>     >        document.write ("<EM>This won't work</EM>")
>     >      </SCRIPT>
> 
>     > A conforming parser must treat the "</EM>" data as the end of
>     > script data, which is clearly not what the author intended.
> 
> Quite frankly, this seems to be exceptionally dumb. Was there a
> sensible reason for this decision?

The arcane rules of SGML, the sensibility of which is beyond the scope
of this forum. The pertinent strictures have been incised on the
standing stones of the ISO, and will remain unchanged til the end of
time.

You can 'legalize' JavaScript by splitting a string:

  document.write ("<EM>This will work<"+"/EM>")

or escaping the slash:

  document.write ("<EM>This will work<\/EM>")

The 'big two' browsers aren't strict about this, and I'm quite sure
most authors haven't a clue.

David Perrell