I would like to know if is better to use application/javascript or application/ecmascript and if i should use application/languagename instead of text/languagename with other languages.
I would like to know if is better to use application/javascript or application/ecmascript and
Share
Officially, IANA (keepers of the official MIME type registry) lists
text/javascriptandtext/ecmascriptas obsolete (via RFC 4329).Of those two, it easiest to use
application/javascript. The use ofapplication/ecmascriptbrings with it stricter character encoding requirements and less forgiving error handling as specified in 4329.Practically, you have to use
text/javascriptif you want it to work in IE.Also, my recommendation is to skip the
typeattribute of<script>tags entirely. Every browser will run your JS just fine without. (You still need to serve .js files with a HTTPContent-Typeoftext/javascript, though.)