View Full Version : XHTML Strict 'language element'
manicman
08-04-2006, 08:34 PM
Whenever I validate my XHTML Strict pages and have used javascript like this:
<script language="javascript" type="text/javascript">
I get an error that says:
there is no attribute "language".
Yet I see valid pages on the web that have this in their source all the time. Can anyone tell me why this is happening.
Thanks. :)
kaitco
08-04-2006, 10:03 PM
Are the valid pages you are looking at valid with Strict or Transitional? The language attribute is deprecated, so unless that content is surrounded by CDATA tags, it will not validate as Strict.
Arbitrator
08-05-2006, 04:23 AM
I get an error that says:
there is no attribute "language".As quoted, language is an attribute, not an element as noted in the thread title.
Whenever I validate my XHTML Strict pages and have used javascript like this:
<script language="javascript" type="text/javascript">
Yet I see valid pages on the web that have this in their source all the time. Can anyone tell me why this is happening.
Thanks. :)The language attribute was deprecated (http://www.w3.org/TR/html4/interact/scripts.html#h-18.2.1) in favor of the type attribute and isn't valid under the strict DTDs of HTML 4.01 and XHTML. The only reason to use it is for backwards compatibility with those really old browsers; in other words, there's no need to use it unless you're specifically targeting an audience using those browsers. Mainly, it's just one of a number of things that have stuck around because people use it without understanding why.
manicman
08-05-2006, 03:02 PM
Thanks, got it sorted now.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.