W3C home > Mailing lists > Public > public-html@w3.org > August 2007

Re: Determining Script Type

From: Sierk Bornemann <sierkb@gmx.de>
Date: Wed, 8 Aug 2007 00:44:09 +0200
Message-Id: <0E4C7441-0DC2-4660-8310-0FF639D0F87B@gmx.de>
Cc: public-html@w3.org
To: Jim Jewett <jimjjewett@gmail.com>

Am 07.08.2007 um 23:47 schrieb Jim Jewett:

> In http://lists.w3.org/Archives/Public/public-html/2007Aug/0354.html,
> Smylers said that the overall default should be "text/javascript", and
> pointed out that the algorithm was for parsing, not authors.  This
> allows further simplification, and I suggest replacing step 1 of
> http://www.whatwg.org/specs/web-apps/current-work/#running0 with the
> following
> """
> The script's type is determined by the value of the script element's
> type attribute.
> A type attribute which is either missing or equal to the empty string
> indicate the default value of "text/javascript", for ECMAScript.
> Otherwise, the attribute's value (which SHOULD be a valid MIME type)
> is used directly.
> For backwards compatibility, if the type attribute is missing (not
> just empty, but missing), user agents SHOULD also check the language
> attribute.  If language is present (and not equal to the empty
> string), then the script's type is treated as "text/" + the value of
> the language attribute.
> """

Caution and to remember:

Why sticking to "text/javascript", although it is deprecated?
Why not following RFC 4329, http://www.ietf.org/rfc/rfc4329.txt,  
which defines valid Scripting Media Types and which

1.a) defines "text/javascript" the first time ever (it has been never  
defined and registered before by IANA or any other formal registry)
1.b) marks "text/javascript" as deprecated (obsolete) and only for  
use in legacy environments
2. defines and recommends "application/javascript" as media type for  
3. defines and recommends "application/ecmascript" as media type for  
ECMAScript ?

All major browser and webserver vendors (Mozilla, Apple, KDE  
Konqueror, Opera, Apache) except Microsoft, have done their homework  
and have adjusted their support for these RFC 4329-recommended  
mimetypes (Apache recently has dropped legacy scripting mimetypes in  
favor to RFC 4329 recommended mimetypes based on application/*, see  
HTML5 should not stick/refer to legacy mimetypes, when there are  
recommended valid new ones, registred with RFC4329 and published on  
http://www.ietf.org/rfc/rfc4329.txt, http://www.iana.org/assignments/ 
media-types/application/ and http://www.iana.org/assignments/media- 
types/text/ .
HTML5 is a formal recommendation and still a work-in-process. If any  
possible, HTML5 should regard RFC 4329 and its recommended mimetypes,  
so that obsolete mimetypes as "text/javascript" won't be specified  
there for the future.

Sierk Bornemann
Sierk Bornemann
email:            sierkb@gmx.de
WWW:              http://sierkbornemann.de/
Received on Tuesday, 7 August 2007 22:44:22 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 29 October 2015 10:15:25 UTC