Chapter 9. Windows and Frames

Windows are playing an important role in JavaScript. The window object is the default object in JavaScript and is used quite often (just consider the windows.alert() method). Also, JavaScript is capable of working with windows (for instance, by opening new ones)—and also with frames and iframes, which are also very similar to window objects.

Example . 

window.open("http://www.samspublishing.com/",
  "samsWindow", "");

The method window.open() opens a new window and expects at least three parameters so that the method call is useful: the URL to open, the new name of the window, and window options.

With the preceding code (file open.html), a new window is opened with the publisher’s homepage opened.

The second parameter of ...

Get JavaScript™ Phrasebook: Essential Code and Commands now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.