PDA

View Full Version : Type vs Language



Keleth
08-20-2008, 10:39 PM
Hey all,

I was hoping for some help on a relatively simple question.

When putting a script tag in, I often enter both 'type="text/javascript"' and 'language="javascript"'. Is one preferred to the other? Does one not matter?

I appriciate any help.

rangana
08-20-2008, 11:56 PM
Use type="text/javascript". This is valid, while language is a deprecated attribute.

It does'nt affect your script's performance though, but rather your page's validity.

For further reading:
http://www.w3.org/TR/html4/interact/scripts.html#edef-SCRIPT

Hope it makes sense.

Twey
08-21-2008, 12:00 PM
The 'language' attribute is deprecated for 'type', as you would know if you had validated your page (http://validator.w3.org/).

codeexploiter
08-22-2008, 08:58 AM
Here is a list of MIME type that can used with the "type" attribute value of script element.

http://krijnhoetmer.nl/stuff/javascript/mime-types/