Document Object Model (DOM) is a description of how an HTML or XML document is represented in a tree structure. DOM provides an object oriented application programming interface that allows parsing HTML or XML into a well defined tree structure and operating on its contents.
Various interfaces were initially implemented by web browsers to manipulate elements in an HTML document through JavaScript. This prompted the World Wide Web Consortium (W3C) to come up with a series of standard specifications that defined the W3C Document Object Model (W3C DOM). The W3C specifications are platform and language independent. The previous vendor-specific interfaces were dubbed intermediate DOMs.
The tree-based implementation requires that the entire content of a document be parsed and stored in memory. Hence, DOM is best used for applications where the document elements have to be accessed and manipulated in an unpredictable sequence and repeatedly. If the application involves a sequential or one-time selective read or write per processed document, DOM presents a considerable overhead. The sequential SAX model is advantageous in such a case in terms of speed and memory consumption.
Since each web browser used to exclusively support its own intermediate DOM, inter-operability problems were abundant. In order to be cross-browser compatible, i.e. support multiple browsers, large parts of Dynamic HTML code had to be rewritten for each browser to be supported. A common DOM promised to greatly simplify the development of complex web applications.
W3C DOM Level 1 has been a recommendation since 1 October, 1998. The standardization effort did not bring forth an immediate change, since non-conformant browsers such as Internet Explorer 4.x and Netscape 4.x were still widely used in 2000. As of 2005, large parts of W3C DOM are well supported by common JavaScript-enabled web browsers, including Microsoft Internet Explorer (version 5 (1999), ... version 6 (2001)), Gecko-based browsers (like Mozilla and Firefox), Opera and Safari. Web developers are starting to mostly or solely rely on W3C DOM, since it doesn't preclude from reaching a large audience.
The article Comparison of layout engines (DOM) shows which methods and attributes may be used safely given certain browser requirements.
W3C standards | XML-based standards | Application programming interfaces
Document Object Model | Document Object Model | Document Object Model | Document Object Model | مدل شیءگرای سند | Document Object Model | 문서 객체 모델 | Document Object Model | Document Object Model | Document Object Model | Document Object Model | Obiektowy model dokumentu | Modelo de Objeto de Documentos | DOM | DOM | Document Object Model | Document Object Model | DOM | 文档对象模型
This article is licensed under the GNU Free Documentation License.
It uses material from the
"Document Object Model".
Home Page • arts • business • computers • games • health • hospitals • home • kids & teens • news • physicians • recreation• reference • regional • science • shopping • society • sports • world