Re: [Bug 6684] Disregard of RFC 4329 and IANA MIME Media Types

Smylers wrote:
> Michael A. Puls II writes:
> 
>> 1. IE needs to be patched for <!DOCTYPE html> so that <script
>> type="application/javascript" and other types mentioned in the RFC
>> execute the JS code.
> 
> To clarify, in current IE <script type="application/javascript"> isn't
> interpreted as JavaScript?

Yes. http://philip.html5.org/demos/js/jstype.html has various examples. 
IE8 (and IE8 in IE7-mode) executes the script when <script type> is:
   text/javascript1.1
   text/javascript1.2
   text/javascript1.3
   text/javascript
   text/jscript
   text/ecmascript
   text/livescript
and no other tested value.

"text/javascript" and "text/ecmascript" appear to be the only types that 
work in all of IE, Firefox, Opera and Safari.

(The HTTP Content-Type of scripts is ignored entirely, as far as I'm 
aware. Some old (September 2007) data at 
http://canvex.lazyilluminati.com/misc/stats/scripttypes2.html indicates 
the most common Content-Type is "application/x-javascript", followed by 
"text/html", then "text/javascript". 
http://canvex.lazyilluminati.com/misc/stats/scripts2.html indicates that 
<script type> is almost always "text/javascript".)

-- 
Philip Taylor
pjt47@cam.ac.uk

Received on Thursday, 2 April 2009 11:04:28 UTC