The Node.ownerDocument property is similar to the document property of an Element object. In this case, because we are considering only DOM nodes, whether the document is HTML or not is of no consequence. For now it probably is because the work centers around browser capabilities but the DOM specification is far more than just a better way to describe a web page.
They have very cleverly separated the description of an abstract document and the 'HTMLness' of it into two layers. That way, implementors can superimpose other types of document content on top of a generic DOM foundation built on the Node structure.
This property is effectively provided by MSIE version 5 as a property of an Element object. Netscape 6.0 makes it available here in a more DOM-compliant manner.
It is a convenience property because accessing a containing document object in this way is far easier than walking down a document.childNode sequence to locate a contained document.
See also: | Document object, Element.ownerDocument |
Prev | Home | Next |
Node.nodeValue | Up | Node.parentNode |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |