Re: Bizarre <script> tag spec

David Perrell (
Mon, 14 Jul 1997 00:20:20 -0700

Message-Id: <>
From: "David Perrell" <>
To: <>
Subject: Re: Bizarre <script> tag spec
Date: Mon, 14 Jul 1997 00:20:20 -0700 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

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