Should I use a type attribute on script tags?
I have immense respect for Douglas Crockford, but that doesn't mean I can't disagree with him... Douglas has written on a number of occasions that he prefers plain script tags, with no attributes. The argument goes like this:
"This script block uses the
language attribute. This was a feature that was introduced by Microsoft in order to support VBScript. Netscape then adopted it to support its own nonstandard deviations. W3C did not adopt the
language attribute, favoring instead a
type attribute which takes a MIME type. Unfortunately, the MIME type was not standardized, so it is sometimes
<script>. It is smallest, and it works on the most browsers."
Except that our good friend IE doesn't recognize them and ignores the script altogether if you use them. So once again, thanks to one more non-standard behavior of IE, we can't afford to follow the standard.