O'Reilly logo

JavaScript™ Phrasebook: Essential Code and Commands by Christian Wenz

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 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 ...

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