Dynamic HTML can be viewed as an evolutionary improvement in browsers, rather than an entirely new, alien technology.
JavaScript commands like window.alert('Frivolous
provide a very simple mechanism for changing that which a browser displays. Such features are provided by a host object (the Text')
object in this case) and have been available since the earliest days of JavaScript. As browser versions increased, more host objects became available, and the extent of JavaScript's control over the browser environment grew. With the 4.0 browsers, the host objects available have reached a kind of critical mass, sufficient to allow very detailed control over the elements of a document, especially in the Internet Explorer 4.0 case. Taking advantage of this detailed control—ordinary JavaScript applied to newly exposed document features—is all Dynamic HTML really is. An important aspect of this control is that it happens after the document is fully loaded and rendered into the browser.window
Put another way, four technologies contribute to Dynamic HTML:
By the time all the latest enhancements for these technologies are rolled together, compatibility levels between Netscape and Microsoft 4.0 browsers are lower than you might otherwise hope for.
JavaScript itself does not contribute much that is new towards dynamic HTML, other than providing a programming mechanism for the host objects innovated by the other technologies. It is the authority that orders those objects' behavior. One exception in the 4.0 browsers is the method
, which is a very handy alternative to setInterval()
. Some Dynamic HTML techniques are repetitious—setTimeout()
allows a piece of script to run periodically.setInterval()
The properties that make up styles are the meat and drink of Dynamic HTML. By altering these style properties, the script writer can change the appearance of an HTML document even after it is fully rendered on the screen. Styles may be expressed in a number of ways, but the most common approaches, which are the ones that contribute to Dynamic HTML, are based on these standards:
In addition, there is a CSS2 draft standard now, but it is not implemented in either of the major 4.0 browsers. These standards can be viewed at
.http://www.w3c.org
Internet Explorer 4.0 has an enhancement to style sheets called filters. Filters may be used for a number of additional effects beyond style sheets' normal capabilities.
With the advent of HTML 4.0, the
, STYLE
and CLASS
tag attributes proliferate widely over most tags. These attributes allow style information to be attached to tags, all accessible from JavaScript. The ID
and <DIV>
tags have new importance because of their ability to associate arbitrary chunks of HTML with a style.<SPAN>
Particular to Netscape 4.0 browsers are the
and <LAYER>
tags. Although these tags have no official future and are made somewhat redundant by the CSS-P draft standard, they do provide a useful host object. Only use <ILAYER>
if you are happy to commit to Navigator 4.0.<LAYER>
The Browser Object Model defines all of the JavaScript host objects in the browser. The Document Object Model describes only those parts of the browser model that depend on the currently displayed HTML document. Because of the widespread adoption and therefore importance of HTML, the object model for HTML is undergoing standardization. DOM is that standard, with level 1 (being part 1) released in draft and implemented in Internet Explorer 4.0 only.
The exposure of the DOM to JavaScript gives access to all the pieces of an HTML document. Apart from allowing style manipulation and so on, this exposure also gives access to the original HTML source text from within JavaScript. Previously, you could only 'View Source' the HTML source interactively.
Consequentially, the DOM allows the content of an HTML document to be changed after the document is loaded. Although the DOM isn't mandatory for Dynamic HTML, the content changing behavior that it enables is the most dynamic aspect possible.
This standard can be viewed at
.http://www.w3c.org