isnoend2001
asked on
Correct way to declare javaScript in html5
When validating my page the validator says the declaring the language is no longer necessary
What i have now
<script type="text/javascript" src="JavaScriptJS/NewFoote r.js"></sc ript>
Is this correct: ?
<script src="JavaScriptJS/NewFoote r.js"></sc ript>
What i have now
<script type="text/javascript" src="JavaScriptJS/NewFoote
Is this correct: ?
<script src="JavaScriptJS/NewFoote
ASKER
W3C warns me not an error
It states it is not necessary.
Just want to be sure removing it from my tags. I am writing it correctly
It states it is not necessary.
Just want to be sure removing it from my tags. I am writing it correctly
Yep, not necessary.
Just checked it again with an HTML5 page and I don't even get a warning about it. Weird you are.
Are you using http://validator.w3.org/
Just checked it again with an HTML5 page and I don't even get a warning about it. Weird you are.
Are you using http://validator.w3.org/
ASKER
looks as though they have removed the warning http://validator.w3.org/
I was getting them last month.
Been using another validator cause http://validator.w3.org was down last week
http://www.onlinewebcheck.com/check.php
It still gives this:
Use the "type" attribute instead, and remove the "language" attribute (which is deprecated in HTML 4.01 and obsolete in HTML5). More: This "script" tag uses one or more entirely obsolete (in HTML5) attributes which must not be used in HTML5 documents. The HTML5 obsolete attributes for "script" include: "event", "for", and "language". This message is displayed up to 5 times.
I was getting them last month.
Been using another validator cause http://validator.w3.org was down last week
http://www.onlinewebcheck.com/check.php
It still gives this:
Use the "type" attribute instead, and remove the "language" attribute (which is deprecated in HTML 4.01 and obsolete in HTML5). More: This "script" tag uses one or more entirely obsolete (in HTML5) attributes which must not be used in HTML5 documents. The HTML5 obsolete attributes for "script" include: "event", "for", and "language". This message is displayed up to 5 times.
ASKER
This validator(http://www.onlinewebcheck.com/check.php) also gives this warning:
Warning:
The natural primary language is not specified. It is highly recommended that the "lang" and/or "xml:lang" (for XHTML) attributes be used with the "html" element to specify the primary language. For example, use lang="en" for English or lang="fr" for French. Specifying the language assists braille translation software, speech synthesizers, translation software, and has other benefits.
<html>
So now i am adding this:
<html lang="en">
Warning:
The natural primary language is not specified. It is highly recommended that the "lang" and/or "xml:lang" (for XHTML) attributes be used with the "html" element to specify the primary language. For example, use lang="en" for English or lang="fr" for French. Specifying the language assists braille translation software, speech synthesizers, translation software, and has other benefits.
<html>
So now i am adding this:
<html lang="en">
ASKER
From http://validator.w3.org
Warning Line 33, Column 74: The language attribute on the script element is obsolete. You can safely omit it.
…ript type="text/javascript" language="javascript" src="js/lytebox.js"></scri pt>
Warning Line 33, Column 74: The language attribute on the script element is obsolete. You can safely omit it.
…ript type="text/javascript" language="javascript" src="js/lytebox.js"></scri
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks
type="text/javascript" - is not necessary for HTML5, it is assumed to be JavaScript
Though I have never had W3C complain about my pages where it still exists...