Re: Problem Validating SCRIPT Element with TYPE Attribute

On Sat, 2003-06-21 at 14:26, Jukka K. Korpela wrote:

> The HTML specifications tell us to use text/javascript for JavaScript, in
> effect. This is not just fake, it is simply wrong by the authoritative
> specification of Internet media types (MIME types) as defined in
> RFCs 2045 through 2049. There is no registered media type text/javascript.
> According to RFC 2046, "Any format without a rigorous and public
> definition must be named with an 'X-' prefix".
> 
> To conclude, if you wish to comply with the syntax specified in HTML
> recommendations, and thereby pass validation against a doctype specified
> there, and you use a script element, you have to violate a widely
> deployed, standards-track Internet protocol by the IETF.

<script type="application/x-javascript"> would be most "correct" [1],
and was the generally accepted best practice too until MSIE 6.something
decided to ignore all scripts with type="application/x-javascript".

<script type="text/javascript"> AFAIK works with all relevant browsers,
but as Jukka noted, it's against the media type RFCs.

See <http://www.robinlionheart.com/stds/html4/scripts.html#type> for
more related info.

[1] Even better if there would be a registered MIME type for 
    (Java/ECMA)Script.

-- 
\/ille Skyttä
ville.skytta at iki.fi

Received on Saturday, 21 June 2003 10:59:53 UTC