Name

Window.open( ) — open a new browser window or locate a named window

Availability

JavaScript 1.0; enhanced in JavaScript 1.1

Synopsis

                  window.open(url, name, features, replace)

Arguments

url

An optional string that specifies the URL to be displayed in the new window. If this argument is omitted, or if the empty string is specified, the new window does not display a document.

name

An optional string of alphanumeric and underscore characters that specifies a name for the new window. This name can be used as the value of the target attribute of <a> and <form> HTML tags. If this argument names a window that already exists, the open( ) method does not create a new window, but simply returns a reference to the named window. In this case, the features argument is ignored.

features

A string that specifies which features of a standard browser window are to appear in the new window. The format of this string is specified in the “Window Features” section. This argument is optional; if it is not specified, the new window has all the standard features.

replace

An optional boolean argument that specifies whether the URL loaded into the new page should create a new entry in the window’s browsing history or replace the current entry in the browsing history. If this argument is true, no new history entry is created. This argument was added in JavaScript 1.1. Note that it doesn’t make much sense to use this argument for newly created windows; it is intended for use when changing the contents of ...

Get JavaScript: The Definitive Guide, Fourth Edition 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.