Multipurpose Internet Mail Extensions. It is a standard used to indicate how content in an e-mail message should be handled, such as, encoding used, data format, part separation, and other specific information. Without this information the software that will interpret it does not know how to treat properly (it could even do an analysis of the content, but not all cases would be possible and would be much more complicated). In general this will route the content to a specific part of the software (a engine renderer, a language interpreter, a plugin , a specific action that the client knows to manipulate, or a external software, etc.).
MIME is now used for protocols other than those used for email.
MIME can contain various information. The most well-known is content type .
What was used in the example is a content type . He makes it clear to the browser that this is a script written in the JavaScript language and should call his interpreter and delegate what to do with it.
The first part indicates that the content is pure text. It could be another type of media or application (to be called), for example. The second part is more specific indicating how it should be interpreted.
Other commonly used information is the version of MIME, metadata and how content is inserted ( Content Disposition ) and Encoding ( Content-Transfer-Encoding / p>
Wikipedia article .
List of MIMEs "recognized" by IANA .
Some browsers can decide on their own what to do with some content, such as script JavaScript. But the standard requires it to be used. And yes, if it is out of the standard, the browser may assume an unexpected behavior.