These days, popup windows are generally frowned upon; however, they can be useful in some cases. We'll look at a couple of examples, but first, let's see how to open a new window.
All four parameters are options:
URL - the URL of the page to load. If it is left blank, a blank window is open and can be written to with
name - the
target attribute of the window. This can be used to reuse an existing window if it is open.
features - a comma-delimited list of window features. Some of the most common are:
height - the height of the window
width - the width of the window
left - the left position of the window
top - the top position of the window
location - whether or not to include the location bar
menubar - whether or not to include the menubar
resizable - whether or not the window should be resizable
scrollbars - whether or not to include scrollbars
status - whether or not to include the status bar
toolbar - whether or not to include the toolbar
replace - true or false. If set to true, the new page replaces the current page (if there is one) in the browser window's history.
top features should be set in pixels.
toolbar features are boolean values: "true" or "false", "yes" or "no", or "1" or "0" will work.
The advises browsers to ignore the
features arguments completely, and some modern browsers do choose to ignore all but the size and positioning features.
The example below shows how to open a new window: