Cross-Browser DHTML: A DOM for all Seasons
October 25, 1998
A DOM for all Seasons
The culprit in this divide is the Document Object Model.
Dynamic HTML is an object-oriented organism and, as
such, the DOM is its anatomy. As its name implies, the
DOM defines the building-block objects which make up a Web
page, and the various characteristic properties which belong
to each of those objects. Interacting with these building
blocks, such as modifying an object's properties or triggering
a behavior as a result of an action at an object,
is therefore defined by the Document Object Model. And, wouldn't
you know it, Netscape and Microsoft have thus
far adopted different DOM's to integrate into their respective
browsers.
In fact, both DOM's share many similar qualities, and even many
compatible objects. Both are, after all, reaching
towards the same goals -- manipulating the components of a
Web page. Even among similar objects, though, there
are sometimes subtle differences which result in different
behaviors depending upon the browser being used. More
troubling, though, are the many major objects which reside
in only one DOM or the other; sometimes there is a similar,
homologous object in the the opposing DOM: consider Netscape's
layer object, whose properties are
mostly mimicked in Microsoft's style object. In
other cases, one DOM possesses an object without equal
in its competitor: Microsoft's IFRAME object
represents an in-line floating frame, a feature which
Netscape does not support.
The upshot of all this heartache is that you, the
cross-browser developer, face three potential obstacles, listed
in order of increasing mental anguish:
1. Features which can be implemented in either browser,
but require different syntaxes;
2. Features which can be implemented in either browser,
but using different approaches;
3. Features which can only be implemented in only one browser,
with an alternative created for the other.
Aside from sheer ingenuity, which this article cannot teach,
we will look at methods for addressing each of
the above three scenarios.
Despite the fact that a new, standardized DOM is promised
from the W3C
(
http://www.w3c.org/dom/),
with contributions from both Microsoft and Netscape, it
is unlikely that all three obstacles listed earlier will
be entirely abolished. These software developers maintain
a distinct interest in maintaining a distinction, and
thus limiting compatibility, between their
browser-cum-operating-systems. Software developers'
dilemmas, then, rarely change over time -- it is only the
specifics which mutate.
Cross-Browser DHTML
Cross-Browser DHTML
Cross-Browser DHTML: A Spork in the Road
|