Home Messages Index
[Date Prev][Date Next][Thread Prev][Thread Next]
Author IndexDate IndexThread Index

Re: Validating JavaScript String

  • Subject: Re: Validating JavaScript String
  • From: Roy Schestowitz <newsgroups@schestowitz.com>
  • Date: Tue, 22 Mar 2005 04:09:27 +0000
  • Newsgroups: alt.html
  • References: <d1nv5n$d2u$1@godfrey.mcc.ac.uk> <1111462629.670566.98220@l41g2000cwc.googlegroups.com>
  • User-agent: KNode/0.7.2
Dan wrote:

> Roy Schestowitz wrote:
>> I find myself unable to validate a page with JavaScript. The strings
> have
>> actual mark-up.
>> I isolated the problematic part and put it in the following address:
>> http://www.schestowitz.com/index-quotes.htm
>> Is there a way of achieving this functionality and still get it to
> validate?
> In all closing tags within the script (e.g., document.write('</P>')),
> precede the slash with a backslash to "escape" it, like
> document.write('<\/P>').  Otherwise, the closing tags are considered
> under SGML rules to terminate the script element.
> There's a lot of mistaken belief out there about what's needed to make
> closing tags within scripts valid; you see a lot of stuff like
> document.write('</scri'+'pt>'), perpretrated by people with a vague
> idea that they need to do something special to prevent the tag from
> being treated as regular HTML, but don't know the actual syntax
> requirements which require escaping the slash.  Once some influential
> designer does it, everybody else seems to slavishly imitate them, in
> cargo-cult fashion.


Thank you very much. This made my day.


[Date Prev][Date Next][Thread Prev][Thread Next]
Author IndexDate IndexThread Index