O'Reilly logo

The Book of JavaScript, 2nd Edition by thau!

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

Opening Windows

To open a window, use the open() method, which opens a window that has the characteristics you specify as parameters inside its parentheses:

var window_name =
    window.open("some_url", "html_name", "feature1,
feature2,feature3,...");

In this example, I've set up a variable called window_name to refer to the window we're opening. When I want to use JavaScript to change or manipulate what's inside the window, I'll refer to this window as window_name. Here window_name is just a variable—you could use any valid JavaScript variable name, such as fido, in its place if you so desired (see Chapter 2 for variable naming rules).

Manipulating the Appearance of New Windows

The three parameters of the window.open() command control the new window's ...

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