Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"The language attribute on the script element is obsolete. You can safely omit it."?

Tags:

According to the W3C validator, I am getting this error:

The language attribute on the script element is obsolete. You can safely omit it.

…uage="JavaScript" src="js/gen_validatorv31.js" type="text/javascript"></script> 

How do I fix this?

I checked through the script and it should not be an issue.

like image 847
Henrik Petterson Avatar asked Apr 03 '12 21:04

Henrik Petterson


People also ask

Is lang attribute compulsory in script tag?

The language attribute in JavaScript is optional since the introduction of HTML5 brought some new improvements. JavaScript became the default language for HTML5 and modern browsers. Therefore, now adding javascript isn't required in <script> tag. This attribute specifies what scripting language you are using.

What are the two important attributes of script tag?

Attributes: Many attribute associated with script tag. async: It is used to specify the script is executed asynchronously. charset: It is used to specify the character encoding used in an external script file. defer: It is used to specify that the script is executed when the page has finished parsing.

What is language attribute in JavaScript?

The language attribute is used to mention the scripting language. Typically, its value will be javascript. Although recent versions of HTML (and XHTML, its successor) have phased out the use of this attribute.

What is attribute in script?

Attributes of HTML script tag It is a boolean value which specifies that the script is executed asynchronously. HTML5. defer. It is a boolean value which is used to indicate that script is executed after document has been parsed. HTML 4.01, HTML5.


1 Answers

<script type="text/javascript" src="js/gen_validatorv31.js"      language="JavaScript"></script> 

You don't need to include redundant language="JavaScript". Specifying just the type and src is valid, language is obsolete, remove it.

like image 71
Brandon Avatar answered Sep 20 '22 09:09

Brandon