|
home >> chapters >> chapter 9 (second edition) An object model defines the interface to the various aspects of the browser and the document that can be manipulated by JavaScript. In JavaScript, there are a variety of object models based upon browser type and version, but in general we see two primary object models employeda Browser Object Model and a Document Object Model (DOM). The Browser Object Model provides access to the various characteristics of a browser such as the browser window itself, the screen characteristics, the browser history, and so on. The DOM, on the other hand, provides access to the contents of the browser window, namely the document including the various (X)HTML elements, CSS properties, and any text items. While it would seem clear, the unfortunate reality is that the division between the DOM and the Browser Object Model is at times somewhat fuzzy and the exact document manipulation capabilities of a particular browser's implementation of JavaScript vary significantly. This section starts our exploration of the use of the various aspects of JavaScript object models that are fundamental to the proper use of the language.We begin this chapter with an exploration of JavaScript's initial object model and then examine the various additions made to the object model by browser vendors. This apparent history lesson will uncover the significant problems with the "DHTML" object models introduced by the browser vendors and still used by many of today's JavaScript programmers and will motivate the rise of the standard DOM model promoted by the W3C, which is covered in the following chapter. Download Chapter 9 (Second Edition) [ PDF - 360KB ] The first edition version of this chapter is archived here for your convenience [ PDF - 1.0MB ]. You will need Adobe Reader to view the above document. Download the free Adobe Reader here. |