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 ...
Get The Book of JavaScript, 2nd 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.