W3C home > Mailing lists > Public > www-validator@w3.org > August 2004

Re: [VE][79] Error Message Feedback

From: olivier Thereaux <ot@w3.org>
Date: Sun, 1 Aug 2004 17:11:49 +0900
Message-Id: <70050D7A-E392-11D8-9907-000A95E54002@w3.org>
Cc: www-validator@w3.org
To: Scott Eade <seade@backstagetech.com.au>
Hi Scott,

Short answer: you're probably better off calling an external script 
than struggling with the necessary escaping when embedding scripts 
within HTML.

slightly longer answer follows...

On Jul 30, 2004, at 12:57, Scott Eade wrote:
> I don't mind so much that the JavaScript variable assignment is being 
> examined for valid mark-up

This feels like a misunderstanding: the validator does not read within 
scripts just because that may be a fun thing to do, but because it is 
the way it is supposed to parse the document.

> , but if it is then it would be nice if the opening tag was also 
> detected.  The more correct thing to do is to probably not validate 
> JavaScript variable assignments (or better still validate them as 
> stand alone fragments).

I am sure you read
>  <http://validator.w3.org/docs/help.html#faq-javascript>.

which points to 
http://www.htmlhelp.com/tools/validator/problems.html#script which 
states:
[[ the first occurrence of "</" followed by any letter is considered 
the end tag for the SCRIPT element ]]

You'll need to escape any instance of </ in your scripts.

-- 
olivier

Received on Sunday, 1 August 2004 04:12:00 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 5 February 2014 07:14:08 UTC