Take the 2-minute tour ×

Basically this is the question. Which is the difference between these two statements:


<script language="javascript" src="_js/calendar/calendar.js"></script>


<script type="text/javascript" src="_js/calendar/calendar.js"></script>
share|improve this question
nothing really. they both run & execute. –  Bottle of Milk Oct 6 '12 at 5:33
Just because they both currently run and execute doesn't mean they have no difference –  Ben Taliadoros Apr 25 '13 at 9:03

3 Answers 3

up vote 6 down vote accepted

Per the HTML 4.01 Spec:

type: This attribute specifies the scripting language of the element's contents and overrides the default scripting language. The scripting language is specified as a content type (e.g., "text/javascript"). Authors must supply a value for this attribute. There is no default value for this attribute.

language: Deprecated. This attribute specifies the scripting language of the contents of this element. Its value is an identifier for the language, but since these identifiers are not standard, this attribute has been deprecated in favor of type.

Language is generally used to indicate the Javascript version that your script requires. Browsers that support the language attribute won't load or run the script if it doesn't support it. About the only use would be if you had critical Javascript functions where you needed workarounds for older browsers.

share|improve this answer
therefore we should avoid using language="javascript"... –  Daniel Ramirez-Escudero Sep 5 '12 at 8:09
Yes. language attribute won't specify the scripting language –  blasteralfred Ψ Sep 5 '12 at 8:17

The language = JavaScript suggests that the language formatting and error-checking is to be based on JavaScript standards. The type = text/javascript only suggests that the inner contents' formatting will be text, in JavaScript form.

But language = JavaScript is deprecated anyway, so don't worry.

share|improve this answer

Taking a look at W3.org language should have been deprecated or removed :

<!ELEMENT SCRIPT - - %Script;          -- script statements -->
  type        %ContentType;  #REQUIRED -- content type of script language --
  src         %URI;          #IMPLIED  -- URI for an external script --
  defer       (defer)        #IMPLIED  -- UA may defer execution of script --
share|improve this answer

Your Answer


