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.
Dan,
Thank you very much. This made my day.
Roy
|
|