Re: Ooops

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).

Yucca

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