Re: Validator should not be interpreting <SCRIPT> tag contents at all

On Tue, 6 Feb 2001, Bryce Nesbitt wrote:

> I've read the FAQ.  I understand the problem.  But still, why
> does this validator interpret the contents of a <SCRIPT></SCRIPT> container?

Because otherwise it wouldn't be a validator at all.  It would therefore
also be letting down SGML-aware browsers, including very probably Mozilla.

> The interpreter can't know what type of script is inside
> the tag, and can't correctly interpret it.

Yes it can - at the SGML level.  And hence also at the HTML level.

> I suggest that the validator would be much more useful if it ignored everything inside <SCRIPT></SCRIPT>.  Cluttering the JavaScript code with \, as in:
> 	document.write("<\/P>");
> To hide it from the validator is not a realistic solution.

It's a nasty hack, and it arises from the rather ill-considered way
scripting is embedded into markup.  But in general you should be
avoiding the problem by putting anything using document.write
(or more-or-less any non-trivial function) away from the HTML
in a <script src="...">.

-- 
Nick Kew

Received on Thursday, 8 February 2001 05:22:11 UTC