O'Reilly logo

JavaScript® Bible, Sixth Edition by Danny Goodman, Brendan Eich, Michael Morrison

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 16. Window and Frame Objects

IN THIS CHAPTER

  • Scripting communication among multiple frames

  • Creating and managing new windows

  • Controlling the size, position, and appearance of the browser window

  • Details of window, frame, frameset, and iframe objects

A quick look at the basic document object model diagram in Chapter 14 (see Figure 14-1) reveals that the window object is the outermost, most global container of all document-related objects that you script with JavaScript. All HTML and JavaScript activity takes place inside a window. That window may be a standard Windows, Mac, or XWindows application-style window, complete with scroll bars, toolbars, and other chrome; you can also generate windows that have only some of a typical window's chrome. A frame is also a window, even though a frame doesn't have many accoutrements beyond scroll bars. The window object is where everything begins in JavaScript references to objects. Modern browsers treat the frameset as a special kind of window object, so it is also covered in this chapter.

Of all the objects associated with browser scripting, the window and window-related objects have by far the most object-specific terminology associated with them. This necessitates a rather long chapter to keep the discussion in one place. Use the running footers as a navigational aid through this substantial collection of information.

Window Terminology

The window object is often a source of confusion when you first learn about the document object model. A ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required