[thelist] What is DOM?

Pete Freitag pf at cfdev.com
Wed Feb 20 16:39:01 CST 2002


DOM stands for the Document Object Model, and it's a way of representing a
document (be it XML or HTML) using Object Oriented programming.  It
basically allows you to have access to any part of the document you want by
calling functions.  You can use DOM in JavaScript, or you can use it to
parse an XML document (extract nodes from it).

The way it usually works is it reads the document, then you can get Access
to the document root (in HTML it would probably be the HTML tag). From there
you can call functions/methods on the node like getAttributes or getChildren
(which would return the child elements of the node (maybe head, and body
elements).  From there you can keep traversing the nodes recursively, and
gathering information from them, or in JavaScript you can actually change
values of things.

DOM is a W3C standard (http://www.w3.org/DOM/), but in the case of
JavaScript you will find differences between browsers, but if you are using
a DOM XML parser (like xerces http://xml.apache.org) you will find that they
typically use standard interfaces.

Here's a good article about using DOM with JavaScript:
http://www.mozilla.org/docs/dom/technote/tn-dom-table/

As far as how necessary it is for a web developer to know, it really depends
on what you do.  If you do a lot of JavaScript then its good to learn about,
if you work with XML a lot then it's also good to learn about, other than
that you wont find much use for it.

_____________________________________________
Pete Freitag (pfreitag at cfdev.com)
CTO, CFDEV.COM
ColdFusion Developer Resources
http://www.cfdev.com/


-----Original Message-----
From: thelist-admin at lists.evolt.org
[mailto:thelist-admin at lists.evolt.org]On Behalf Of Syed Zeeshan Haider
Sent: Wednesday, February 20, 2002 5:09 PM
To: Evolt
Subject: [thelist] What is DOM?


Hello Experts,
I have read about DOM at many places but too much complex technical
language has always been an obstacle in my way to learn about DOM. Can
somebody tell me what DOM really is? How can it be important for web
development? To which extent is it necessary for web developer to learn
about DOM?
Thank you,
Syed Zeeshan Haider.
http://syedzeeshanhaider.faithweb.com/


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

--
For unsubscribe and other options, including
the Tip Harvester and archive of thelist go to:
http://lists.evolt.org Workers of the Web, evolt !




More information about the thelist mailing list