In this hour, you will explore this hierarchy of objects. Hour 9 covers the following topics:
How to access the various objects in the DOM
Working with windows using the window object
Working with Web documents with the document object
Using objects for links and anchors
Using the location object to work with URLs
Getting information about the browser with the navigator object
Understanding the Document Object Model
Like other objects you've explored, the objects in the DOM have properties, which describe the Web page or document, and methods, which allow you to work with parts of the Web page.
The window object is the parent object for all the objects we will be looking at in this hour. Figure 9.1 shows this section of the DOM object hierarchy and a variety of its objects.
This diagram only includes the basic browser objects that will be covered in this hour. These are actually a small part of the Document Object Model, which you'll learn more about starting with Hour 18, "Working with Style Sheets."
History of the DOM
The bad news is that there are still differences between the browsersbut here's the good news. Since the release of Netscape 3.0 and Internet Explorer 4.0, all the basic objects (those covered in this hour) are supported in much the same way in both browsers, and new DOM standards are supported by the latest versions of Netscape and Internet Explorer.
While all this standardization doesn't change how the objects described in this hour work, you'll be thankful for it as you move into the advanced features of the DOM later in this book.
The W3C (World-Wide Web Consortium) has recently developed the DOM level 1 standard. This standard defines not only basic objects, but an entire set of objects that encompass all parts of an HTML document. A level 2 DOM standard is also under development.
The basic object hierarchy described in this hour is informally referred to as DOM level 0, and the objects are included in the DOM level 1 standard. You'll learn how to use the full set of Level 1 DOM objects in Part V of this book.
The Level 1 and Level 2 DOM objects allow you to modify a Web page in real time after it has loaded. This is called dynamic HTML (DHTML) and you'll learn more about it in Part V.