Document (Object model)

An organized collection of objects that represent a document.

The document object is the foundation around which a scriptable interface to an HTML or XML document is constructed. This is sometimes referred to as the DOM and is subject to its own standardization exercise being managed by W3C and other interested parties.

The DOM has its origins in the MSIE version 4 browsers. Version 3 of MSIE and versions of Netscape prior to version 6 implement a more miscellaneous collection of objects that behave a bit like a DOM but are not really a standards-compliant model.

There are areas where the so called DOM support in each browser is so different as to render any script access to the document either problematical or virtually impossible with the same script. This means that you need to support parallel development of HTML and JavaScript to be able to cover both competing browsers.

Now that Netscape 6.0 converges on the same standards-based DOM model as MSIE, we can look forward to a much more portable future for our scripts. So long as we can disregard legacy versions and steer clear of the still quite large number of differences, we should be able to to do much more across different browsers without needing to code differently for each one. History suggests it is also equally likely that they will diverge in other areas where they introduce new features.

The starting point for the DOM hierarchy is the <HTML> HTML tag, although the <BODY> HTML tag is realistically the root of the DOM.

Until the version 5/6 browsers ship, the existing DOM support is referred to as Level 0. The current standard is level 1 and level 2 is on the horizon.

The basic approach to the DOM differs between the browsers on these points:

Warnings:

See also:Compatibility, Document object, DOM, Event handler scope

insert figure 0040

Web-references:

   http://msdn.microsoft.com/redirs/inetsdkredir.asp
   http://www.w3.org/TR/WD-DOM/