Brian Cryer wrote:
Out of curiosity, when I use onclick="...some JavaScript ..." why do I not
need to flag that its JavaScript, but when I define a script on a page I do
need to tag it (<script type="text/javascript">...)?
Is it part of the standard that event handlers (onclick etc) are always
JavaScript?
The HTML 4 standard
<URL:http://www.w3.org/TR/html4/interact/scripts.html#h-18.2.2.1>
mandates that you provide a HTTP header or a meta element
<meta http-equiv="Content-Script-Type" content="text/javascript">
but I don't know of browsers implementing that, they either support only
JavaScript and therefore default to JavaScript in event handlers or
(IE/Win) they have their own way of choosing the language: with IE the
first script element and its language or type attribute determine the
language for event handlers, additionally you can put the language in an
attribute to indicate the language on a per element basis
<input type="button" value="test" language="VBScript"
onclick="MsgBox window.event.type">
--
Martin Honnen
http://JavaScript.FAQTs.com/