ECMAScript

When Navigator 2 made its debut, it provided built-in client-side scripting with JavaScript. Despite what its name might imply, the language was developed at Netscape, originally under the name LiveScript. It was a marketing alliance between Netscape and Sun Microsystems that put the “Java” into the JavaScript name. Yes, there are some striking similarities between the syntax of JavaScript and Java, but those existed even before the name was changed.

Internet Explorer 3 introduced client-side scripting for that browser. Microsoft provided language interpreters for two languages: VBScript, with its syntax based on Microsoft’s Visual Basic language, and JScript, which, from a compatibility point of view, was virtually 100% compatible with JavaScript in Navigator 2.

It is important to distinguish a programming language, such as JavaScript, from the document object model that it scripts. It is too easy to forget that document objects are not part of the JavaScript language, but are rather the “things” that programmers script with JavaScript (or VBScript). The JavaScript language is actually more mundane in its scope. It provides the nuts and bolts that are needed for any programming language: data types, variables, control structures, and so on. This is the core JavaScript language.

From the beginning, JavaScript was designed as a kind of core language that could be applied to any object model, and this has proven useful. Adobe Systems, for example, uses JavaScript as the core scripting language for Acrobat Forms scripting. The same core language you use in HTML documents is applied to a completely different object model in Acrobat Forms.

To head off potentially disastrous incompatibilities between the implementations of core JavaScript in different browsers, several concerned parties (including Netscape and Microsoft) worked with a European computer standards group now known only by its acronym: ECMA. The first published standard, ECMA-262 (www.ecma.ch/stand/ecma-262.htm), also known as the politically neutral ECMAScript, is essentially the version of JavaScript found in Navigator 3. Both Navigator 4 and Internet Explorer 4 implement this ECMA standard (with only very esoteric exceptions). In addition, the Version 4 browsers both extend the work of the first ECMA release in a consonant fashion. The core JavaScript language in Navigator 4 (JavaScript 1.2) is supported almost to the letter by JScript in Internet Explorer 4.

After the dissonance in the object model arena, it is comforting for web authors to see so much harmony in the core language implementation. For the objects in the core JavaScript language, Chapter 11, provides a complete reference.

Get Dynamic HTML: The Definitive Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.