Overview of the Document Object Model Reference
a single location that had everything. I was jumping between MSDN, Quirksmode, MDC, and W3C constantly. So when there isn't a resource available, I decided
to make one myself. Please enjoy it and hopefully you'll find it as helpful as I do.
Throughout the documentation you may see small labels which denote what specification that property or method was made available.
Where possible, this is indicated by the small labels next to their names: DOM 2
This reference also makes use of Quirksmode's compatibility rating system.
||Supported completely and correctly
||Supported completely and correctly except for a minor issue
||Supported correctly but not completely
||Supported in an alternative way
||Depends on another method or property that is not supported
||Just barely supported but unusable in practice
||Returns incorrect object or value and becomes badly usable
||Does something it should not do
To create this manual, I've referenced compiled information from numerous sites. Below are links to the sites referenced.
This manual covers numerous specifications and attempts to bring it all into a usable interface. Below are the specifications addressed in this reference manual. For convenience here is a link to all W3C DOM Specifications.
© 2009 Adobe Systems Incorporated. All rights reserved.
DOM Level 0
The term "DOM Level 0" refers to a mix (not formally specified) of HTML document functionalities offered by Netscape Navigator version 3.0 and Microsoft Internet Explorer version 3.0. In some cases, attributes or methods have been included for reasons of backward compatibility with "DOM Level 0".
DOM Level 1
The DOM Level 1 specification is separated into two parts: Core and HTML. Core Level 1 provides a low-level set of fundamental interfaces that can represent any structured document, as well as defining extended interfaces for representing an XML document. HTML Level 1 provides additional, higher-level interfaces that are used with the fundamental interfaces defined in Core Level 1 to provide a more convenient view of an HTML document. Interfaces introduced in DOM1 include, among others, the Document, Node, Attr, Element, and Text interfaces. All interfaces contain attributes and/or methods that can be used to interact with XML and HTML documents.
DOM Level 2
The DOM Level 2 specification contains six different specifications: The DOM2 Core, Views, Events, Style, Traversal and Range, and the DOM2 HTML.
- DOM Level 2 Core - extends the functionality of the DOM1 Core. It also contains specialized interfaces dedicated to XML. Examples of methods introduced in the DOM2 Core include the famous getElementById, and many namespace-related methods.
- DOM Level 2 Views - allows programs and scripts to dynamically access and update the content of a representation of a document. The introduced interfaces are AbstractView and DocumentView.
- DOM Level 2 Events - gives a generic event system to programs and scripts. It introduces the concepts of event flow, capture, bubbling, and cancellation. Famous methods here include addEventListener and handleEvent. Several interfaces make your life easier when dealing with events: EventTarget, EventListener, Event, DocumentEvent, MouseEvent, MutationEvent, etc. However, it does not include an interface for the keyboard events, which will be dealt with in later versions of the DOM.
- DOM Level 2 Style - allows programs and scripts to dynamically access and update the content of style sheets. It has interfaces for Style Sheets, Cascading Style Sheets, CSSRule, CSSStyleDeclaration, the famous getComputedStyle, the many many CSS2Properties, and all the media rules you can imagine.
- DOM Level 2 Traversal and Range - allow programs and scripts to dynamically traverse and identify a range of content in a document. The DOM2 Traversal provides interfaces like NodeIterator and TreeWalker to easily traverse the content of a document. The DOM2 Range allows the creation, insertion, modification, and deletion of a range of content in a Document, DocumentFragment, or Attr. It can be characterized as selecting all of the content between a pair of boundary-points.
- DOM Level 2 HTML - allows programs and scripts to dynamically access and update the content and structure of HTML documents. It extends the interfaces defined in the DOM1 HTML, using the DOM2 Core possibilities. It introduces the contentDocument property, a useful way to access the document contained in a frame.
DOM Level 3
The DOM Level 3 specification contains five different specifications: The DOM3 Core, Load and Save, Validation, Events, and XPath.
- DOM Level 3 Core - will extend the functionality of the DOM1 and DOM2 Core specs. New methods and properties include adoptNode(), strictErrorChecking, and textContent, to name only a few.
- DOM Level 3 Load and Save - allows programs and scripts to dynamically load the content of an XML document into a DOM document, and serialize a DOM document into an XML document.
- DOM Level 3 Validation - allows programs and scripts to dynamically update the content and the structure of documents while ensuring that the document remains valid, or to ensure that the document becomes valid.
- DOM Level 3 Events - is the extension of the DOM2 Events specification. This specification mainly focuses on keyboard events and how to handle them.
- DOM Level 3 XPath - provides simple functionalities to access a DOM tree using XPath 1.0.
- Web Storage - defines two APIs for persistent data storage in Web clients.
- Selectors API - defines methods for retrieving Element nodes from the DOM by matching against a group of selectors.
- Element Traversal - allows script navigation of the elements of a DOM tree, excluding all other nodes in the DOM, such as text nodes. It also provides an attribute to expose the number of child elements of an element.
- CSSOM View Module - provide authors with a way to inspect and manipulate the view information of a document. This includes getting the position of element layout boxes, obtaining the width of the viewport through script, and also scrolling an element.
Thu Apr 2 2009, 01:08 AM -07:00