If you look at html5boilerplate.com they never use any type on their <script>
tags. Hmm... but is there more to it?
If you don't specify a type, the default becomes "text/javascript" but according to RFC4329 the "text/javascript" MIME type is obsolete in favor of "application/javascript".
If the default MIME type for a <script>
tag thus becomes either "text/javascript" or "application/javascript" is there any sensible browser on this green earth that would not translate a piece of inline Javascript code as, exactly that; Javascript? Probably not.
What about <script>
tags with a src
attribute? Does the type matter?
I read the spec a couple of times and it feels like reading legalese but it ultimately says: the value of the type
tag must be that of the body of the script
tag.
So, what happens if you embed a javascript file with a mismatching type? Let's see: