Core language standard
Keeping track of JavaScript language versions requires study of history and politics. History covers the three versions developed by Netscape; politics covers Microsoft’s versions and the joint standards effort. The first version of JavaScript (in Navigator 2) was Version 1.0, although that numbering was not part of the language usage. JavaScript was JavaScript. Version numbering became an issue when Navigator 3 was released. The version of JavaScript associated with that Navigator version was JavaScript 1.1. As you will learn later in this book, the version number is sometimes necessary in an attribute of the HTML tags that surround a script. The Navigator 4.x generation increased the language version one more notch with JavaScript 1.2.
Microsoft’s scripting effort contributes confusion for scripting newcomers. The first version of Internet Explorer to include scripting was Internet Explorer 3. The timing of Internet Explorer 3 was roughly coincidental to Navigator 3. But as scripters soon discovered, Microsoft’s scripting effort was one generation behind. Microsoft did not license the JavaScript name. As a result, the company called its language JScript. Even so, the HTML tag attribute that requires naming the language of the script inside the tags could be either JScript or JavaScript for Internet Explorer. Internet Explorer 3 could understand a JavaScript script written for Navigator 2.
During this period of dominance by Navigator 3 and Internet Explorer 3, scripting newcomers were often confused because they expected the scripting languages to be the same. Unfortunately for the scripters, there were language features in JavaScript 1.1 that were not available in the older JavaScript version in Internet Explorer 3. Microsoft improved JavaScript in IE3 with an upgrade to the .dll file that gives IE its JavaScript syntax. However, it’s hard to know which .dll is installed in any given visitor’s IE3. The situation smoothed out for Internet Explorer 4. Its core language was essentially up to the level of JavaScript 1.2 in Navigator 4. Microsoft still officially called the language JScript. Almost all language features that were new in Navigator 4 (including the script tag attribute identifying JavaScript 1.2) were understood when you loaded the scripts into Internet Explorer 4.
While all of this jockeying for JavaScript versions was happening, Netscape, Microsoft, and other concerned parties met to establish a core language standard. The standards body is a Switzerland-based organization originally called the European Computer Manufacturer’s Association and now known simply as ECMA (commonly pronounced ECK-ma). In mid-1997, the first formal language specification was agreed on and published (ECMA-262). Due to licensing issues with the JavaScript name, the body created a new name for the language: ECMAScript. With only minor and esoteric differences, this first version of ECMAScript was essentially the same as JavaScript 1.1 found in Navigator 3. Both Navigator 4 and Internet Explorer 4 supported the ECMAScript standard. Moreover, as happens so often when commerce meets standards bodies, both browsers went beyond the ECMAScript standard. Fortunately, the common denominator of this extended core language is broad, lessening authoring headaches on this front.
IE5 advances to JavaScript version 1.3, while NN6 has the luxury of implementing JavaScript 1.5. In the meantime, the ECMA standard has evolved to a new release that incorporates features found in JavaScript 1.3 and 1.5. While the core language tends to exhibit the most compatibility between IE and
NN, authors must pay attention to which language features are available in the browsers visiting scripted pages. Older browser versions are not equipped to handle newer JavaScript features. But you can sometimes script around these incompatibilities (as described throughout the language reference in Part IV).

0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home