• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Part III: JavaScript > The Document Object Model

Chapter 19. The Document Object Model

by Jim O'Donnell

In this chapter

Web Browser Object Hierarchy and Scoping

The window Object

The location Object

The history Object

The document Object

JavaScript Object Arrays

The link, area, and anchor Objects

The form Object

The image Object

In Chapter 18, "Introduction to JavaScripting," you learned the basics of JavaScript—its syntax, control structures, and how to use it to access and manipulate objects. To be useful, however, something to manipulate is needed. How does JavaScript (or any other scripting language, for that matter) interact with your Web browser?

The answer is the Document Object Model. Each script-compatible Web browser, mainly Netscape Navigator and Microsoft Internet Explorer, exposes a number of objects that can be used to control and interact with the browser. The sum total of these objects is the browser's object model.

As you would expect, the object models that Netscape and Microsoft have developed for their Web browsers are not completely compatible. Not only do differences exist between the models from the two vendors, but each revision of their Web browsers also differs from the last—they are largely backward compatible but include many new capabilities. This chapter examines those elements of the Document Object Model that are (for the most part) common to all Netscape and Microsoft Web browsers, version 3 and higher. (Differences are noted in the discussion.) Later chapters discuss some of the major changes that have occurred with the advent of support for Cascading Style Sheets and Dynamic HTML.

→ To read about Microsoft's enhanced Document Object Model, see "Internet Explorer Document Object Model,"



Not a subscriber?

Start A Free Trial

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint