W3C home > Mailing lists > Public > www-validator@w3.org > January 2013

Re: Ooops

From: Jukka K. Korpela <jkorpela@cs.tut.fi>
Date: Tue, 15 Jan 2013 20:23:10 +0200
Message-ID: <50F59E8E.2010908@cs.tut.fi>
To: www-validator@w3.org
2013-01-15 17:18, Walter Phipps wrote:

> While working out how to validate my website for XHTML, I pressed the
> "Validate the page" button for
> http://www.w3schools.com/html/demo_xhtml.asp

The w3schools site is notorious for its incorrect information and its 
continued use of a domain name that confuses many people; the site has 
nothing to do with the W3C. For more info see http://w3fools.com

> and it came up with 5 errors, all with the same Error message.

I'm not surprised, but to be fair even to w3schools, it must be stated 
that the page does not contain a "Valid HTML!" icon. So you must have 
used some button in your browser, or something like that.

> /required attribute "type" not specified /

So they omit the "type" attribute from <script> tags. No big deal. It 
was never actually required by browsers or other software; they default 
to treating the content as JavaScript anyway.

But the XHTML 1.0 document type definition makes the attribute 
mandatory. People usually use type="text/javascript". For the purposes 
of validation, you could just as well use type="hello world!" or, more 
confusingly, type="text/javascirpt". But then browsers would treat the 
content as being in an unrecognized language and would just ignore it.

Thus, in practical terms, it's best to omit the type attribute from 
script elements (unless you specifically want to prevent browsers from 
interpreting the content as a script).

Received on Tuesday, 15 January 2013 18:23:41 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:59:32 UTC