Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
window ObjectsAt the top of the browser object hierarchy is the window object, which represents a browser window. You’ve already used at least one method of the window object: method, or simply alert(), displays a message in an alert box.
Note
The DOM is not part of JavaScript or any other programming language—rather, it’s an API (application programming interface) built in to the browser.
There can be several window objects at a time, each representing an open browser window. Frames are also represented by window objects. You’ll learn more about windows and frames in Chapter 20, “Using Windows and Frames.”
The window object is the parent object for all the objects we will be looking at in this chapter. Figure 15.1 shows the window section of the DOM object hierarchy and a variety of its objects.