W3C home > Mailing lists > Public > www-validator@w3.org > April 2008

Re: Javascript "for" Statement and AJAX "Query String"

From: David Dorward <david@dorward.me.uk>
Date: Sat, 26 Apr 2008 10:08:53 +0100
Cc: www-validator@w3.org
Message-Id: <23A011D6-73F5-4EFF-A98F-A1A449DC6126@dorward.me.uk>
To: Yotam Haran <yotamharan2@gmail.com>


On 26 Apr 2008, at 09:43, Yotam Haran wrote:

> Of course the validator is not meant to hide validity issues, but  
> the problem is it marks things as invalid when they are not.

No, it doesn't. Read the specification. The document IS invalid.

> Placing the script in a seperate file will have the same effect as  
> ignoring the contents of script tags, and will also be slower than a  
> script that is actually on-page, so why not use the latter option?

One is valid, the other is not. Worse, the existing code is a well  
formedness error, so when the document is parsed as XML, the parser  
will thrown an error. This would result in the yellow screen of death  
in Firefox.

There are ways to include such scripts inline in XHTML, but they  
aren't Appendix C compatible and you are claiming your XHTML is text/ 
html.

> Is there any point in the validator marking these things as invalid?

The validator just follows the DTD. XML DTDs (unlike SGML DTDs) can't  
mark the content of elements as CDATA, so script elements are handled  
differently then in HTML.

> I mean, isn't the point of the validator to help people fix their  
> markup? The errors thrown out concerning the javascript are by no  
> means helpful, and thus pointless in my opinion.

The extended information about that error could be improved with a  
note about handling the error within script and style elements.

Please send responses to the mailing list, not directly to me.

-- 
David Dorward
http://dorward.me.uk/
http://blog.dorward.me.uk/
Received on Saturday, 26 April 2008 09:09:30 GMT

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