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

Re: Missing attribute in a <script> element (Was: Re: [VE][127] Add Subject Here)

From: Jukka K. Korpela <jkorpela@cs.tut.fi>
Date: Fri, 13 Jun 2008 12:59:57 +0300
Message-ID: <00fd01c8cd3c$3cf9b9f0$0300000a@DOCENDO>
To: <www-validator@w3.org>
Cc: "Eglitz Multimedia Solution Provider" <info@eglitz.co.in>

Sierk Bornemann wrote:

> Am 13.06.2008 um 08:35 schrieb Jukka K. Korpela:
>
>> According to RFC 4329 ( http://www.faqs.org/rfcs/rfc4329.html ), that
>> value is obsolete; in reality, the preferred "application/javascript"
>> may have more limited browser support.
>
> Only Internet Explorer and some older browsers lack the support for
> the mimetypes "application/javascript" and "application/ecmascript".

Thus, for the vast majority browsing situations, browsers do not support 
those inventions. IE is still the dominant browser, whether we like this 
or not. My statement "may have more limited browser support" is actually 
my candidate for nomination as the understatement of the year.

Even IE 7 does not recognize them. If you use

<script type="application/javascript" ...>...</script>

then IE simply ignores the entire <script> element, since it treats its 
language as unknown. This does not happen if you simply omit the 
type="..." attribute, so in a sense, the validator's message (though 
quite correct of course) can actually make things worse.

If you use the type="..." attribute (as you should by the DTD, but 
browsers don't really care if you omit it), use a value that is 
recognized by relevant software. On the web, "text/javascript" is the 
only sensible option, for now and for a few years at least.

Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/ 
Received on Friday, 13 June 2008 10:02:57 GMT

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