The Document Object Model
February 15,1999
Although events are commonly referred to as "part of"
JavaScript,
technically they are not. In fact,events are defined in the
Document Object Model
supported by the browser. The DOM, as it is known, is
a complex being in and of itself -- in brief, it defines
the anatomy of a web page and how the components of a
page may be exposed to a programming language for access
or modification.
Technically speaking, the DOM is independent of
JavaScript itself;
rather JavaScript is a programming language which can access the
DOM.
It needn't be the only one -- Internet Explorer 4 also supports
VBScript,
a Microsoft-specific programming language, which can
also access the DOM.
The point here is not simply one of splitting hairs.
While Navigator and Internet Explorer support very similar
JavaScript
implementations (compatible with the
ECMAScript standard)
they do not share the same
Document Object Model.
This is
the root of the divergence in support for events.
|
A Note on the
DOM:
Recently the
World Wide Web Consortium (W3C),
the international
standards body, approved of a specification for a
standardized Document Object Model. This standardized
DOM, a potential boon to cross-browser
web development, is not exactly supported in the
fourth generation browsers. Furthermore, the W3C DOM does not
specify events, so even though the fifth generation
browsers may support a compatible DOM, support for events may
still differ. |
The general difference between the Microsoft fourth
generation DOM and the Netscape fourth generation DOM is
one of flexibility and scope -- Microsoft's DOM exposes
many more elements of the page to the programming language
and support many events at these elements. Netscape's DOM
is far more conservative, limiting the scope of events
available at each element, and limiting the number of
elements of the page one can access.
Events in JavaScript: An Inside Look
Events in JavaScript: An Inside Look
Event Handler Basics
|