[Bug 3413] If <META http-equiv="Content-Script-Type" content="text/javascript"> is set, then <SCRIPT src="foo.js"></SCRIPT> should be accepted without the "type" attribut.

http://www.w3.org/Bugs/Public/show_bug.cgi?id=3413





------- Comment #4 from pgaries@fastmail.us  2007-01-04 06:23 -------
> Am I wrong? Or it's a bug?

The "Content-Script-Type" only refers to the content of event attributes such
as "onmouseover", "onmouseout", "onchange", "onkeypress", et cetera, not the
"script" element. That's similar to the way "Content-Style-Type" refers to
"style" attributes, not the "style" element. In any case, the "type" attribute
is required by the DTD, so it must be present for the document to be valid.

>From the part of the specification you referred to:
"Documents that do not specify default scripting language information and that
contain elements that specify an intrinsic event script are incorrect. User
agents may still attempt to interpret incorrectly specified scripts but are not
required to."

In other words, if you use event attributes, you should specify
"Content-Script-Type" or face the (unlikely, but justified) event that a
browser will simply ignore that attribute's content because it doesn't know the
content type.

Received on Thursday, 4 January 2007 06:23:46 UTC