Main Page

JavaScript Implementations

JavaScript Implementations
Although ECMAScript is an important standard, it is not the only part of JavaScript, and certainly not
the only part that has been standardized. Indeed, a complete JavaScript implementation is made up of
three distinct parts (see Figure 1-1):
?
The Core (ECMAScript)
?
The Document Object Model (DOM)
?
The Browser Object Model (BOM)
Figure 1-1
ECMAScript
ECMAScript
doesn’t have ties to any browser in particular and, actually, has no methods for user input
or output to speak of. (It is not unlike languages such as C, which rely on external libraries to accomplish
such tasks.) So what is ECMAScript? ECMA-262 (p. 2) describes it like this:
“ECMAScript can provide core scripting capabilities for a variety of host environments, and therefore
the core scripting language is specified...apart from any particular host environment.”
A Web browser is considered a host environment for ECMAScript, but it is not the only host environment.
Indeed, numerous other environments (such as Nombas’s ScriptEase and Macromedia’s ActionScript,
used in both Flash and Director MX) can host ECMAScript implementations. So what does ECMAScript
specify outside of a browser? To put it simply, ECMAScript describes the following:
?
Syntax
?
Types
?
Statements
?
Keywords
?
Reserved Words
?
Operators
?
Objects
ECMAScript is simply a description, defining all the properties, methods, and objects of a scripting lan-
guage. Other languages implement ECMAScript, as JavaScript does (see Figure 1-2), as the baseline for
functionality.
JavaScript
ECMAScript DOM
BOM
3
What Is JavaScript?
04_579088 ch01.qxd 3/28/05 11:34 AM Page 3


JavaScript EditorFree JavaScript Editor     Ajax Editor


©

R7