Netscape: The DOM
November 19, 1998
Unfortunately, we necessarily begin with a confusing
caveat: despite the fact that the DOM as a construct is
distinct from JavaScript the language, Netscape's documentation
integrates its reference material on the DOM into
its JavaScript Reference materials. This can lead to some confusion.
Some objects contained in the Netscape documentation,
such as the string object, belong to JavaScript, the
programming language. Other objects, such as the window
object, are actually part of the DOM, accessed via
JavaScript. As long as JavaScript and the DOM are intertwined
this distinction may seem esoteric, but it is an important
reminder that the DOM and the JavaScript language are
actually born from two separate specifications.
With regards to Netscape, it is generally accurate to
suggest that the DOM "begins" at the window
object; all objects which are children of the window
object are also part of the DOM. The notable exception
to this is the navigator object, whose properties
provide information about the browser version, which is
a peer object of window rather than a child. Netscape
provides a reasonable graphical overview of their
DOM found in the image below. This image links to the
Netscape page from which it has been mirrored.
An overview of the Netscape Document Object Model.
Netscape does not publish a single DOM-specific reference
document; rather, we must currently work with two documents
to learn the Netscape DOM. First and foremost,
Netscape's JavaScript Reference
contains detailed information on most DOM objects and their
properties, methods, and events. As stated previously, this
resource integrates reference material on both JavaScript
the language and the Document Object Model. As far as the DOM
is concerned, we are interested in the following chapters:
Chapter 5 - "Document",
Chapter 6 - "Window",
Chapter 7 - "Forms",
Chapter 8 - "Browser", and
Chapter 9 - "Events and Event Handlers".
Unfortunately, Netscape has chosen to dedicate an entirely
separate document -
"Dynamic HTML in Netscape Communicator" -
to coverage of DOM objects which support
layers and style sheets, which we should also consider
part of the DOM reference. Specifically, we're interested in
Chapter 5 - "Style Sheet Reference: New JavaScript Object
Properties" and
Chapter 9 - "Using JavaScript with
Positioned Content".
Of course, there are books on the market which consolidate
this information into an easier-to-read format; however,
these books necessarily trade-off timeliness for friendliness --
changes to the DOM may quickly render parts of
such a book obsolete, until the next edition.
Once you know where to look for DOM reference half the battle
is won. Reading the DOM itself is not terribly
difficult, assuming you already understand the meanings
of objects, properties, methods, and events, and understand
how to use them with a programming language such as JavaScript.
Perhaps, for example, you remember that the Netscape
DOM provides a text object which reflects a single-line
text input form field. However, you don't exactly
know what properties or method this object supports. So, we
open a browser to the aforementioned
Chapter 7 of Netscape's JavaScript Reference,
which presents us with a table of supported form-related
objects:
Near the bottom of this table you can (faintly) see the
text object. Click that link and you'll be presented
with (9 pages of ) full-on anatomy of the text object, including
illustrations and example code. Jackpot.
Use the DOM, Luke
The Document Object Model Dissected
Microsoft: DOM, the Sequel
|