W3C home > Mailing lists > Public > www-validator@w3.org > June 2003

Re: Problem Validating SCRIPT Element with TYPE Attribute

From: Ville Skyttä <ville.skytta@iki.fi>
Date: 21 Jun 2003 17:59:45 +0300
To: www-validator@w3.org
Message-Id: <1056207585.31471.42.camel@bobcat.ods.org>

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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:14:09 GMT