DHTML
  Home arrow DHTML arrow Rough Guide To The DOM (part 1)
Dev Shed Forums 
Administration  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
DHTML

Rough Guide To The DOM (part 1)
By: Vikram Vaswani, (c) Melonfire
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 9
    2001-04-09

    Table of Contents:
  • Rough Guide To The DOM (part 1)
  • Back To Basics
  • Navigating The Family Tree
  • What's In A Name?
  • Ducks In A Row
  • Changing Things Around
  • Alternatives
  • Shazam!

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    CIO Insight
     
    ADVERTISEMENT

    TestComplete™ automates software testing for a fraction of what the big guys charge. Easy functional and load testing for all Windows, .NET, Java and Web apps. Download a free trial now.

    Rough Guide To The DOM (part 1)
    (Page 1 of 8 )

    In Shakespeare's "Hamlet", one of the characters famously remarks,"Something's rotten in the state of Denmark". And each time I sit down tocode some dHTML, I'm assailed by a sense of wonder at his perspicuity. Thatcomment, laden with an undertone of doom, is such a perfect appraisal ofthe numerous incompatibilities between the two major browsers, and theproblems they cause for developers on a daily basis, that it's hard not tolaugh. And I would...if I wasn't already weeping buckets.

    These incompatibilities are particularly glaring in an area known as theDOM, or Document Object Model, a standard method of accessing each andevery element in the document, together with its attributes. When aprimitive version of the DOM was first introduced, developers immediatelyrealized how useful it could be in adding new levels of interactivity to astatic Web page. However, as the two major browsers branched out indifferent directions, developing DOM constructs that were mutuallyincompatible, that elation quickly turned to disappointment - after all, nodeveloper likes writing different versions of the same script for differentbrowsers.

    Of course, all is not lost. Efforts have been under way, most noticeably atthe W3C [http://www.w3.org/] to establish common standards for allbrowsers. The release of the CSS specification, and then of the DOM Level 0and Level 1 specifications, has resulted in most of the major browsersfalling in line with the proposed standards. The flip side: since astandard is now available, browser makers will soon stop supporting theirprevious DOM versions...which means that all the code you wrote and theclever workarounds you devised will no longer work in newer versions of thebrowsers.

    You can already see this happening - code written specifically for Netscape4.x no longer works in Netscape 6.x, which is built on the Mozilla engine -and so, every developer needs to understand the new DOM standard and itsimpact on dHTML code development.

    Over the next few pages, I'll be illustrating some of the new DOMconstructs, together with examples of how they can be used in "real" HTMLdocuments. My trusty steed in this journey will be Mozilla, the wonderfulopen-source browser available at http://www.mozilla.org/, which claims tobe the most standards-compatible browser currently available.

    Before we start, a few disclaimers.

    One, this tutorial is not meant to be an exhaustive reference to the DOM -you can buy a book for that. It is merely a guide to help you in making thetransition to the new object model.

    Second, I don't claim to be an expert on the DOM, and much of the materialin this tutorial is based on my own experience as a developer.

    Finally, as new DOM standards are proposed and disposed, the material heremay become invalid; you should always refer to the most current standard orrecommendation at http://www.w3.org/DOM/ for up-to-date information (thisis one of my favourite documents - I use it frequently when I have troublesleeping.)

    With the formalities out of the way, let's get started.

    More DHTML Articles
    More By Vikram Vaswani, (c) Melonfire


     

       

    DHTML ARTICLES

    - Rough Guide To The DOM (part 2)
    - Rough Guide To The DOM (part 1)
    - Filters And Transitions In IE5
    - Understanding Embedded Fonts




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway