Multipurpose Internet Mail Extensions. It is a standard used to indicate how content in an email message should be treated, such as:
- encoding used,
- data format,
- split
- and other specific information.
Without this information the software that will interpret it does not know how to treat properly (it could even make an analysis of the content, but not all cases this 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 how to handle, or an external software, etc.).
Today MIME is used for protocols other than those used for e-mail.
MIME can contain several information the best known is the content type.
What was used in the example is a content type. It makes it clear to the browser that that is a script written in the Javascript language and should call your interpreter and delegate what to do with that.
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 MIME version, metadata and how the content is inserted (Content Disposition) and coding (Content-Transfer-Encoding).
Wikipedia article.
List of mimes "recognized" by IANA.
Some browsers can decide for themselves what to do with some content, as is the case of script Javascript. But the default requires it to be used. And yes, if it is outside the standard, the browser can assume unexpected behavior.
Here has a very objective and effective explanation on the subject (it is in English).
– Weslley Tavares