Using the suggested ones inside the
type attribute will cause Internet Explorer not to use the script, but you can safely use them server-side thanks to browsers ignoring that completely. (Previously: 1 and 2.) All made possible by the The Björn Höhrmann Project. Thanks!
How can the text/ ones be found obsolete (and I quote) "because they've been found to be problematic", when they're the only ones that actually work consistently?
Gotta love the mimetype wars...
Dustin, didn’t I say you could use the new media type? James, yeah, I don’t know about that. I personally think we should just make
text/xml) and solve the issues it has in some revision. Fortunately you can unobsolete media type registrations so that should be doable at some point.
Note that (AFAIK) Mozilla-based UAs treat
text/ecmascript identically, but
application/ecmascript more strictly than the others.
Nothing needs to change with the RFC IMO. If you need to use the obsolete types for compatibility, that's fine. Obsolete doesn't necessarily mean invalid.
How can the text/ ones be found obsolete (and I quote) “because they’ve been found to be problematic”, when they’re the only ones that actually work consistently?
This comments fails to make sense on several levels. The new MIME types were introduced exactly because the
text/* ones don’t work well. Of course the new ones don’t work consistently yet – just how ever could they, when they’re new and not yet widely supported? And just because the old ones work consistently for some value of “work” does not mean they’re not problematic, either, does it?
Aristotle: It'd just be nice to have the new ones working first before the old ones are thrown out.
from PHP, but haven't seen any mention about it here.
Should I change it ? I believe it has never failed me...
This comments fails to make sense on several levels. The new MIME types were introduced exactly because the text/* ones don’t work well. Of course the new ones don’t work consistently yet – just how ever could they, when they’re new and not yet widely supported? And just because the old ones work consistently for some value of “work” does not mean they’re not problematic, either, does it?
RFC 2046 states that text media types are for
textual information [for which] no special software is required to get the full meaning of the text whereas application media types are for
information to be processed by an application.
Furthermore, data with an application media type
can pose security problems which must be understood by implementors and this can certainly be an issue with these scripting languages.
According to Google Doctype, Internet Explorer will pretty much ignore HTTP MIME types altogether, and will even interpret HTML sent as image/jpeg. I know it will interpret HTML sent as text/plain. Yet another case of Microsoft trying too hard to be clever, and ending up being a pain.
And I've just tried the test page you linked to, and even Firefox accepted the script with the dodgy MIME type, which surprises me.