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

Re: Faulty claims of certain errors

From: David Dorward <david@dorward.me.uk>
Date: Thu, 28 Apr 2011 20:02:58 +0100
Cc: <www-validator@w3.org>
Message-Id: <F5DFDD0B-AA62-4FAE-B371-8D96532B3A52@dorward.me.uk>
To: <cj@mb-soft.com> <cj@mb-soft.com>

On 28 Apr 2011, at 17:48, <cj@mb-soft.com> <cj@mb-soft.com> wrote:

> Your validator fails every time it encounters a
> document.write

That suggests you are writing markup with document.write. It is very easy to write invalid X/HTML this way, but the reasons differ depending on which markup language you are using.

> in JavaScript.  All my 22,000 web-pages contain a JS display of the current
> page name, page location, and most recently updated date, and they have
> always worked fine,

Browsers have to deal with the scribblings of many people who either don't understand HTML properly, or have simply made a mistake. The ability of a browser to recover from an error does not mean an error does not exist.

> FYI, When a page contains the Google language translate snippet, validator
> thinks there are around 25 errors and warnings in that single line!

Google has never been held up as an example of how to write high quality markup.

> An example is http://mb-soft.com/public/adversit.html

> That page and most of the others also claims two other errors, which are
> fine.

The first error looks like an attempt to set a CSS property on an element with JavaScript  by using the JS as an attribute instead of wrapping it in an event handler. This is an error.

The second error complains that the (mandatory) action attribute is missing. Browsers will tend to recover by assuming you mean action="the URL of the current page", but this is also an error.

The third error is the one you complain about within document.write. This is, again, an error in the document, not with the validator. The explanation for the error message includes the phrase "If this error occurred in a script section of your document, you should probably read this FAQ entry." Following the link there will take you to an explanation that covers your exact situation.

> For entertainment, try using validator on any page which you used the Google
> page to translate, as you get thousands of claimed errors, for every
> sentence in the text!

Again, Google is not a paragon of good markup practises. 

David Dorward
Received on Thursday, 28 April 2011 19:03:34 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 1 March 2016 14:18:03 UTC