My understanding is that mime types are set by the web server. Why do we add the type="text/javascript or type="text/css" attribute? Isn’t this a useless and ignored attribute?
My understanding is that mime types are set by the web server. Why do
Share
Douglas Crockford says:
He also says:
For entertainment purposes only, I tried out the following five scripts
On Chrome, all but script 3 (
type="baloney") worked. IE8 did not run script 1 (type="application/ecmascript") or script 3. Based on my non-extensive sample of two browsers, it looks like you can safely ignore thetypeattribute, but that it you use it you better use a legal (browser dependent) value.