Exposing the Document with the DOM and dHTML
July 26, 1999
Dynamic HTML (dHTML)
provides a way to combine plain HTML,
cascading style sheets,
and
scripting
languages into a much
richer browsing experience. In fact, as dHTML becomes a reality,
it becomes more honest to talk about fully client-side web
applications that rarely need to contact the web server.
Like we'd seen with JavaScript and VBScript, dHTML exposes
GUI
widgets to the programmer so that she can manipulate them.
However, unlike what we'd seen before with JavaScript and
VBScript, developers had much more available to them beyond the
browser and the form widgets. In fact dHTML has
a much more diverse universe of widgets available to it.
This is because of the use of the
Document Object Model (DOM) and
style sheets (like Cascading Style Sheets [CSS])
The DOM is used to create virtual widgets out of the components
of an HTML document. Using the DOM, for example, not only are
the Netscape menu bar, bookmark list, and window accessible
GUI widgets, but so are every paragraph in an HTML document, a
table cell, and even an individual character of text. Each
element in a document becomes a virtual widget.
Style sheets are used to apply style attributes to
each of the elements in the DOM. Thus, a style sheet might define
the margin, color, and size of a paragraph of text.
Since document components become widgets, they also become exposed
to a scripting language like JavaScript or VBScript that can
modify the attributes of their style just as they would modify
the attributes of any other widget.
As such, a client-side scripting language can be used to modify
any element on the page. Perhaps you want to make a word flash
through a cycle of colors, perhaps you want to change the colors
in a table depending on the data entered. Perhaps you want to
generate a slide show. All this can be done on the client side
using dHTML.
As you can see, dHTML is not so much a technology itself as a
synthesis of many technologies.
Unfortunately, dHTML is still very new and as such, has not
been standardized between browsers. In fact, Netscape and
Internet Explorer use almost completely different models such
that many dHTML features will simply not work on both browsers.
However, like all web technologies, though there will always
be cross platform issues of some kind, they will get more
standardized over time. dHTML is one of the most exciting
technologies released to this date, and promises to completely
change the way web applications are created in a few years.
Exposing the Browser API with Client-side Scripting
Introduction to the Web Application Development Environment (Tools)
Summing up
|