Java Reference
In-Depth Information
of no use in making the scripting of client-side objects compatible between the main browsers. Some
incompatibilities remain.
All current implementations of JavaScript are expected to conform to the current ECMAScript stan-
dard, which is ECMAScript edition 3, published in December 1999. As of November 2006, ECMAScript
edition 4 is under development.
Although there used to be quite a few irregularities between the Microsoft and Netscape dialects of
JavaScript, they're now similar enough to be considered the same language. The Opera and Safari browsers
also support and offer the same kind of support for the standard. This is a good example of how standards
have provided a uniform language across browser implementations, although a feature was similar to the
one that took place over HTML still rages to a lesser degree over JavaScript.
It's now time for you to consider the Document Object Model itself.
The Document Object Model
The Document Object Model (DOM) is, as previously mentioned, a way of representing the document
independent of browser type. It allows a developer to access the document via a common set of objects,
properties, methods, and events, and to alter the contents of the web page dynamically using scripts.
Several types of script languages, such as JavaScript and VBScript, are available. Each requires a dif-
ferent syntax and therefore a different approach when you're programming. Even when you're using a
language common to all browsers, such as JavaScript, you should be aware that some small variations
are usually added to the language by the browser vendor. So, to guarantee that you don't fall afoul of a
particular implementation, the W3C has provided a generic set of objects, properties, and methods that
should be available in all scripting languages, in the form of the DOM standard.
The DOM Standard
We haven't talked about the DOM standard so far, and for a particular reason: It's not the easiest stan-
dard to follow. Supporting a generic set of properties and methods has proved to be a very complex
task, and the DOM standard has been broken down into separate levels and sections to deal with the
different areas. The different levels of the standard are all at differing stages of completion.
Level 0
Level 0 is a bit of a misnomer, as there wasn't really a level 0 of the standard. This term in fact refers to
the “old way” of doing things — the methods implemented by the browser vendors before the DOM
standard. Someone mentioning level 0 properties is referring to a more linear notation of accessing prop-
erties and methods. For example, typically you'd reference items on a form with the following code:
document.forms[0].elements[1].value = “button1”;
We're not going to cover such properties and methods in this chapter, because they have been super-
seded by newer methods.
Search WWH ::




Custom Search