40 Part III . Document Objects (Web site optimization) Reference tags

40 Part III . Document Objects Reference Statements inside the tag set execute only upon the firing of the event. No function definitions are required. This way of binding an object s event to a script means that there is no event handler defined in the element s tag. Therefore, it guarantees that only IE4 or later can carry out the script when the event occurs. But the tag and attributes contain a lot of source code overhead for each object s script, so this is not a technique that you should use for script statements that need to be called by multiple objects. Also be aware that you cannot use this tag variation if non-IE or pre-IE4 browsers load the page. In such browsers, script statements execute as the page loads, which certainly causes script errors. JavaScript versus JScript and VBScript As previously explained, Internet Explorer s version of JavaScript is called JScript. As a result, Internet Explorer s default script language is JScript. While Internet Explorer acknowledges the LANGUAGE= JavaScript attribute, Netscape Navigator ignores the LANGUAGE= JScript attribute. Therefore, if you write scripts that must work in all scriptable browsers, you can specify one language ( JavaScript ) and count on all browsers interpreting the code correctly (assuming you take into account other browser compatibility issues). An entirely different issue is Internet Explorer s other scripting language, VBScript. This language, a derivative of Visual Basic, works only in Win32 versions of IE. You can mix scripts from both languages in the same document, but their tag sets must be separate with the LANGUAGEattributes clearly specifying the language for each