What is the difference between these headers?
Which one is best and why?
Please do not say they are identical – if they were identical there would not have been three of them. I know both work – but I would like to know the difference.
x- prefix) for a transitional period until
You should use
As far a browsers are concerned, there is no difference (at least in HTTP headers). This was just a change so that the
application/* MIME type groups had a consistent meaning where possible. (
Note that using
type attribute of a script element will cause the script to be ignored (as being in an unknown language) in some older browsers. Either continue to use
This isn’t a problem in HTTP headers as browsers universally (as far as I’m aware) either ignore the HTTP content-type of scripts entirely, or are modern enough to recognise
mime-types starting with
Additional the second code snippet
short_open_tags to be enabled. you should avoid it.
attribute gives the language of the script or format of the data. If
the attribute is present, its value must be a valid MIME type. The
charset parameter must not be specified. The default, which is used if
Deployed Scripting Media Types and Compatibility
Various unregistered media types have been used in an ad-hoc
fashion to label and exchange programs written in ECMAScript and
| text/jscript | text/livescript |
Use of the “text” top-level type for this kind of content is known to be
ecmascript but marks them as “obsolete”. Use of experimental and
unregistered media types, as listed in part above, is discouraged.
The media types,
which are also defined in this document, are intended for common
use and should be used instead.
This document defines equivalent processing requirements for the
Use of and support for the media type application/ecmascript is
considerably less widespread than for other media types defined in
this document. Using that to its advantage, this document defines
stricter processing rules for this type to foster more interoperable