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

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?

With the above suggested doctype-dependent change, code relying on it
brittle: a chunk of HTML which gets copied elsewhere or syndicated as
part of another page could end up with another doctype.  Whereas using
text/javascript would be robust against this.

> 3. The HTML5 authoring guide needs to suggest using <script
> type="application/javascript" or suggest omitting @type if dealing
> with browsers that don't execute JS when presented with <script
> type="application/javascript".

That means authors have to think about this and make a judgement about
which browsers their users use -- something which they may guess
incorrectly.  It's also implicitly condoning writing HTML which targets
(or excludes) particular browsers.  And it's more complicated that
simply saying to use text/javascript everywhere.

Indeed, a careful author reading the above such advice would realise the
choice is between a term which works for everybody and one which only
works for some users; given that no information is provided about the
latter having any disadvantage, she may as well always choose the
latter, just in case.

So we may as well short-cut that process: rather than some complicated
conditional text which will result in authors choosing text/javascript,
simply clearly say to use text/javascript -- same result, but with less
hassle.

Smylers

Received on Thursday, 2 April 2009 10:00:12 UTC