W3C home > Mailing lists > Public > www-validator@w3.org > February 2001

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

From: Nick Kew <nick@webthing.com>
Date: Thu, 8 Feb 2001 10:21:59 +0000 (GMT)
To: Bryce Nesbitt <bryce@obviously.com>
cc: www-validator@w3.org, gerald@w3.org
Message-ID: <Pine.BSF.4.21.0102081015440.581-100000@fenris.webthing.com>
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

This archive was generated by hypermail 2.3.1 : Tuesday, 1 March 2016 14:17:28 UTC