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

Re: Bug in HTML 4.01 Test: JavaScript is checked?

From: olivier Thereaux <ot@w3.org>
Date: Wed, 18 Feb 2009 09:29:59 -0500
To: Daniel Marschall <info@daniel-marschall.de>
Message-Id: <B956DD93-4EE5-4E01-BC61-E53D798E5F9E@w3.org>
Cc: <www-validator@w3.org>
Hello Daniel.

On 17-Feb-09, at 6:07 PM, Daniel Marschall wrote:

> Dear Sir or Madam.
>
> I think I have found a bug in the validator check tool.
>
> I made a Anti-Spam-Mechanism which outputs following html code:
> [snip]
> Note: This is a JavaScript, it should be ignored by the validator!  
> It has no line breaks to make it a bit more complex.

That is a common misunderstanding. If the js script is within HTML,  
then it has to abide by the rules of HTML...
http://www.htmlhelp.com/tools/validator/problems.html#script

Solutions:
* use an external js file
* be wary of using document.write(), especially in XHTML

Hope this helps,
-- 
olivier
Received on Wednesday, 18 February 2009 14:30:11 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:14:34 GMT