Best web hosting site - 144Part IIIDocument Objects ReferenceThe JavaScript version implemented in

144Part IIIDocument Objects ReferenceThe JavaScript version implemented in a browser is not always a good predictor of core lan- guage features available for that browser. For example, while JavaScript 1.2 (as implementedby Netscape in NN4) included broad support for regular expressions, not all of those featuresappeared in Microsoft s corresponding JScript implementation in IE4. By the same token, Microsoft implemented try-catcherror handling in its JScript in IE5, but Netscape didn tinclude that feature until the Mozilla-based NN6 implementation of JavaScript 1.5. Therefore, the language version number is far less important than the browser version in determiningwhich language features are available for you to use. Core Language Standard ECMAScriptAlthough Netscape first developed the JavaScript language, Microsoft incorporated the languagein Internet Explorer 3. Microsoft did not want to license the Java name from its trademarkowner (Sun Microsystems), which is why the language became known in the IE environment asJScript. Except for some very esoteric exceptions and the pace of newly introduced features, thetwo languages are essentially identical. The levels of compatibility between browser brands for acomparable generation are remarkably high for the core language (unlike the vast disparities inobject model implementations discussed in Chapter 14). As mentioned in Chapter 2, standards efforts have been under way to create industry-wide recommendations for browser makers to follow (to make developers lives easier). The corelanguage was among the first components to achieve standard status. Through the Europeanstandards body called ECMA, a formal standard for the language has been agreed to and pub- lished. The first specification for the language, dubbed ECMAScript by the standards group, was roughly the same as JavaScript 1.1 in Netscape Navigator 3. The standard defines how various data types are treated, how operators work, what a particular data-specific syntaxlooks like, and other language characteristics. A newer version (called version 3) adds manyenhancements to the core language (version 2 was version 1 with errata fixed). You can viewthe current version of the ECMA-262 specification at http://www.ecma-international.org/. If you are a student of programming languages, you will find the document fascinating; if yousimply want to script your pages, you will probably find the minutia mind-boggling. Both Netscape and Microsoft have pledged to make their browsers compliant with the ECMAstandard. The vast majority of the ECMAScript standard has appeared in Navigator since version 3 and Internet Explorer since version 4. And, as new features are added to the ECMAstandard, they tend to find their way into newer browsers as well. The latest version ofECMAScript is version 3, which is supported in JavaScript 1.5 (Moz1) and JScript in IE6. Version 4 of ECMAScript is currently in the works, along with comparable implementations ofJavaScript (2.0) and JScript by The Mozilla Foundation and Microsoft, respectively. Embedding Scripts in HTML DocumentsScriptable browsers offer several ways to include scripts or scripted elements in your HTMLdocuments. Not all approaches are available in all versions of every browser, but you havesufficient flexibility starting with Navigator 3 and some versions of Internet Explorer 3. Whenyou consider that the vast majority of computer users are now using at least version 4browsers, it s safe to assume a core level of script support among Web users. Exceptions tothis rule include users who have specifically turned off scripting in their browsers, someorganizations that install browsers with scripting turned off, and users with physical disabili- ties who require specialized browsers. Note