I thought that the DOM was XmlHttpRequest (in mozilla based clients) and
XMLHTTP in IE land.
So why do I see the window.document object (the document property of the
javascript client-side global object) referred to as the DOM object.
I'm confused now as to which one is which.
Julian Turner - 30 Nov 2006 11:45 GMT
> I thought that the DOM was XmlHttpRequest (in mozilla based clients) and
> XMLHTTP in IE land.
[quoted text clipped - 3 lines]
>
> I'm confused now as to which one is which.
Hi
DOM (Document Object Model) generally refers to the whole range of
objects which browsers make available to script to manipulate HTML and
XML documents. Take a look at <URL:http://www.w3.org/DOM/> for the
standards.
A DOM object I would interpret as being any one of the objects forming
part of that range. Thus an HTML "P" element is a DOM object that
implements the HTMLParagraphElement interface.
Equally some may use DOM object to refer just to the object which is
the root of the XML or HTML document, i.e. which implements Document
(if XML) and HTMLDocument as well (if HTML) interfaces.
In which case this may be "window.document", or the XML document
returned by the responseXML property of the XmlHttpRequest object.
Regards
Julian
Martin Honnen - 30 Nov 2006 13:30 GMT
> I thought that the DOM was XmlHttpRequest (in mozilla based clients) and
> XMLHTTP in IE land.
[quoted text clipped - 3 lines]
>
> I'm confused now as to which one is which.
responseXML on a XMLHttpRequest/XMLHTTP object gives you an XML DOM
document.
window.document gives you an HTML DOM document in IE and in Mozilla and
Opera it will depend on the type of document sent, it can be a HTML DOM
document, an XML DOM document, an SVG DOM document (or a XUL document).

Signature
Martin Honnen
http://JavaScript.FAQTs.com/