Creates a new secondary browser window and loads the referenced resource.
WindowObjectReference = window.open(strUrl, strWindowName [, strWindowFeatures]);
The open method creates a new secondary browser window, similar to choosing New Window from the File menu. The strUrl parameter specifies the URL to be fetched and loaded in the new window. If strUrl is an empty string, then a new blank, empty window is created with all the default toolbars of the main window.
<script type="text/javascript">
var WindowObjectReference; /* Declaring a global variable
which will store a reference to the new window to be created */
function openRequestedPopup()
{
WindowObjectReference = window.open("http://www.cnn.com/", "CNN_WindowName",
"menubar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes");
}
</script>
<script type="text/javascript">
var WindowObjectReference; // global variable
function openRequestedPopup()
{
WindowObjectReference = window.open("http://www.domainname.ext/path/ImageFilename.png",
"DescriptiveWindowName", "resizable=yes,scrollbars=yes,status=yes");
}
</script>
You can use the open method on an existing window, and if you pass the empty string for the URL, then you will get a reference to the existing window, but not load anything into it. You can then, for example, look for properties of that window or access its methods, assuming your code stores accordingly that returned window object reference and assuming that your main versus secondary window relationship complies with Same origin policy security requirements.
strWindowFeatures is an optional string containing a comma-separated list of requested features of the new window. After a window is opened, you can not use JavaScript to change the window functionalities and the window toolbars.
If strWindowName does not specify an existing window and if you do not supply the strWindowFeatures parameter (or if the strWindowFeatures parameter is an empty string), then the new secondary window will render the default toolbars of the main window.
If the strWindowFeatures parameter is used and if no size features are defined, then the new window dimensions will be the same as the dimensions of the most recently rendered window.
If the strWindowFeatures parameter is used and if no position features are defined, then the left and top coordinates of the new window dimension will be 22 pixels off from where the most recently rendered window was.
An offset is universally implemented by browser manufacturers (it is 29 pixels in MSIE 6 SV1 with the default theme) and its purpose is to help users to notice new windows opening. If the most recently used window was maximized, then there is no 22 pixels offset: the new, secondary window will be maximized as well.
If you define the strWindowFeatures parameter, then the features that are not listed, requested in the string will be disabled or removed (except titlebar, close and hotkeys which are by default yes).
Tip: If you use the strWindowFeatures parameter, then only list the features you want to include in the new window, that you want to be enabled or rendered; the others (except titlebar, close and hotkeys) will be disabled, removed.
There are 4 groups of windowFeatures which can be specified:
Note on position and dimension error correction
Bug 176320: Minimal innerWidth/innerHeight values for popup windows
Note on precedence
Specifies the distance the new window is placed from the left side of the work area for applications of the user's operating system to the leftmost border (resizing handle) of the browser window. The new window can not be initially positioned offscreen.
Supported in:
,
,
,
,
, ![]()
Specifies the distance the new window is placed from the top side of the work area for applications of the user's operating system to the topmost border (resizing handle) of the browser window. The new window can not be initially positioned offscreen.
Supported in:
,
,
,
,
, ![]()
Specifies the height of the content area, viewing area of the new secondary window in pixels. The height value includes the height of the horizontal scrollbar if present. The minimum required value is 100.
Note on outerHeight versus height (or innerHeight)
Supported in:
,
,
,
,
,
, ![]()
Specifies the width of the content area, viewing area of the new secondary window in pixels. The width value includes the width of the vertical scrollbar if present. The width value does not include the sidebar if it is expanded. The minimum required value is 100.
Supported in:
,
,
,
,
,
, ![]()
Deprecated. Same as left but only supported by Netscape and Mozilla-based browsers.
Supported in:
,
,
,
, ![]()
Deprecated. Same as top but only supported by Netscape and Mozilla-based browsers.
Supported in:
,
,
,
, ![]()
Specifies the height of the whole browser window in pixels. This outerHeight value includes any/all present toolbar, window horizontal scrollbar (if present) and top and bottom window resizing borders. Minimal required value is 100.
Note: since titlebar is always rendered, then requesting outerHeight=100 will make the innerHeight of the browser window under the minimal 100 pixels.
Note on outerHeight versus height (or innerHeight)
Supported in:
,
,
,
, ![]()
Specifies the width of the whole browser window in pixels. This outerWidth value includes the window vertical scrollbar (if present) and left and right window resizing borders.
Supported in:
,
,
,
, ![]()
Same as height but only supported by Netscape and Mozilla-based browsers. Specifies the height of the content area, viewing area of the new secondary window in pixels. The innerHeight value includes the height of the horizontal scrollbar if present. Minimal required value is 100.
Note on outerHeight versus height (or innerHeight)
Supported in:
,
,
,
, ![]()
Same as width but only supported by Netscape and Mozilla-based browsers. Specifies the width of the content area, viewing area of the new secondary window in pixels. The innerWidth value includes the width of the vertical scrollbar if present. The innerWidth value does not include the sidebar if it is expanded. Minimal required value is 100.
Supported in:
,
,
,
, ![]()
If this feature is set to yes, then the new secondary window renders the menubar.
Mozilla and Firefox users can force new windows to always render the menubar by setting
dom.disable_window_open_feature.menubar
to true in about:config or in their user.js file.
Supported in:
,
,
,
,
, ![]()
If this feature is set to yes, then the new secondary window renders the Navigation Toolbar (Back, Forward, Reload, Stop buttons). In addition to the Navigation Toolbar, Mozilla-based browsers will render the Tab Bar if it is visible, present in the parent window.
Mozilla and Firefox users can force new windows to always render the Navigation Toolbar by setting
dom.disable_window_open_feature.toolbar
to true in about:config or in their user.js file.
Supported in:
,
,
,
,
, ![]()
If this feature is set to yes, then the new secondary window renders the Location bar in Netscape 4.x and in Mozilla-based browsers. MSIE 5+ and Opera 7.x renders the Address Bar.
Mozilla and Firefox users can force new windows to always render the location bar by setting
dom.disable_window_open_feature.location
to true in about:config or in their user.js file.
MSIE 7 forces the presence of the Address Bar by default:
"We think the address bar is also important for users to see in pop-up windows. A missing address bar creates a chance for a fraudster to forge an address of their own. To help thwart that, IE7 will show the address bar on all internet windows to help users see where they are."
coming from IE7 Blog, November 2005, Better Website Identification
As part of anti-phishing counter-measures, Mozilla.org also intends to soon force the presence of the Location Bar in upcoming releases of Firefox 2:
Bug 337344: Change default dom.disable_window_open_feature.location to true
Supported in:
,
,
,
,
,
, ![]()
If this feature is set to yes, then the new secondary window renders the Personal Toolbar in Netscape 4.x, Netscape 6.x, Netscape 7.x and Mozilla browser. It renders the Bookmarks Toolbar in Firefox 1.x and, in MSIE 5+, it renders the Links bar. In addition to the Personal Toolbar, Mozilla browser will render the Site Navigation Bar if such toolbar is visible, present in the parent window.
Mozilla and Firefox users can force new windows to always render the Personal Toolbar/Bookmarks toolbar by setting
dom.disable_window_open_feature.directories
to true in about:config or in their user.js file.
Supported in:
,
,
,
,
, ![]()
Same as directories but only supported by Netscape and Mozilla-based browsers.
Supported in:
,
,
,
, ![]()
If this feature is set to yes, then the new secondary window has a status bar. Users can force the rendering of status bar in all Mozilla-based browsers, in MSIE 6 SV1 (Note on status bar in XP SP2) and in Opera 6+. The default preference setting in recent Mozilla-based browser releases, in Firefox 1.x and in MSIE 7 is to force the presence of the status bar.
Note on status bar
Supported in:
,
,
,
,
, ![]()
If this feature is set to yes, then it makes the new secondary window resizable.
Note: Mozilla-based browsers since version 1.4 will have a window resizing grippy
at the right end of the status bar; this is to assure users that they can resize a browser window even when the web author explicitly or implicitly requested to make such secondary window non-resizable. In such case, the maximize/restore down system command icon in the titlebar will be disabled and window resizing borders will be unresponsive but the window will still be resizable via that window resizing grippy in the status bar.
Tip: For accessibility reasons, it is strongly recommended to always set this feature to yes.
Mozilla and Firefox users can force new windows to be easily resizable by setting
dom.disable_window_open_feature.resizable
to true in about:config or in their user.js file.
Mozilla.org also intends to soon force the resizability of popup windows in Firefox 3:
Bug 177838: Make all popup windows resizable, ignoring resizable=no
Supported in:
,
,
,
,
, ![]()
If this feature is set to yes, then the new secondary window renders scrollbar(s) if needed, only if content overflows requested window dimensions.
Tip: For accessibility reasons, it is strongly encouraged to always set this feature to yes.
Mozilla and Firefox users can force new windows to render scrollbar(s) when needed, when a document content overflow occurs by setting
dom.disable_window_open_feature.scrollbars
to true in about:config or in their user.js file.
Note on scrollbars
Supported in:
,
,
,
,
, ![]()
If set to yes, the new window is said to be dependent of its parent window. A dependent window closes when its parent window closes. A dependent window is minimized on the Windows task bar only when its parent window is minimized. On Windows platforms, a dependent window does not show on the task bar. A dependent window also stays in front of the parent window.
dependent feature is not implemented on MacOS X.
The dependent feature is currently under revision to be removed (bug 214867)
The MSIE 6 almost equivalent to the dependent feature can be obtained by the recourse of the showModelessDialog( ) method. (bug 194404)
Supported in:
,
,
,
, ![]()
The dialog feature removes the menu system commands (Restore, Minimize, Maximize) and its equivalent icons on the titlebar. Mozilla 1.2+ and Netscape 7.1 will render the other menu system commands (in FF 1.0 and in NS 7.0x, the command system menu is not identified with the Firefox/NS 7.0x icon on the left end of the titlebar: that's probably a bug. You can access the command system menu with a right-click on the titlebar). Dialog windows are windows which have no minimize system command icon and no maximize/restore down system command icon on the titlebar nor in correspondent menu item in the command system menu. They are said to be dialog because their normal, usual purpose is to only notify info and to be dismissed, closed. On Mac systems, dialog windows have a different window border and they may get turned into a sheet.
Supported in:
,
,
, ![]()
This setting can only possibly apply to dialog windows. If minimizable is set to yes, then the new dialog window will have a minimize system command icon in the titlebar and it will be minimizable. If the new window is not a dialog window, then this setting has no impact on the presence of the minimize system icon in the titlebar. In practice, the minimizable window feature is rarely seen and very rarely necessary or useful since non-modal windows are all and always minimizable.
Supported in:
,
,
,
, ![]()
Do not use. Not implemented in Mozilla. There are no plan to implement this feature in Mozilla.
This feature no longer works in MSIE 6 SV1 the way it worked in MSIE 5.x. Certains parts of the interface stops functioning in MSIE 5.x.
fullscreen always upsets users with large monitor screen or with dual monitor screen. Forcing fullscreen on other users is also extremely unpopular and is considered as an outright rude attempt to impose the web author's viewing preferences onto the users.
Note on fullscreen
Supported in: ![]()
fullscreen does not work really work in MSIE 6 SV1.
Deprecated. Do not use. Always implemented in Mozilla-based browsers. There are currently no plan to implement the copyhistory feature either. When set to yes, the history session of the parent window is available and is copied into the new secondary window in Netscape 4: the location bar history (which lists the sites in the location bar drop-down list) of the parent window is copied and available in the new secondary window in Netscape 4.
Supported in: ![]()
Deprecated. Do not use. Always active in Mozilla-based browsers. There are currently no plan to implement the hotkeys feature either. If set to yes, hotkeys used to make menu shortcut keys (like Alt+F4 to close the application, Ctrl+O to open a file, Ctrl+P to print the document, etc.) activable despite menubarless window in Netscape 4. Shortcut keys activating menu items or system menu items are implemented and always active in Mozilla-based browsers even if the menubar is not present, is not visible.
Supported in: ![]()
The following features require the UniversalBrowserWrite privilege, otherwise they will be ignored. Chrome scripts have this privilege automatically, others have to request it from the Privilege Manager.
Note: Starting with Mozilla 1.7/Firefox 0.9, this feature requires the UniversalBrowserWrite privilege (bug 244965). Without this privilege, the chrome feature is ignored.
If set to yes, the new window loads a window as its content. The new chrome window is not a normal browser window. chrome=yes will override scrollbars=no and will render scrollbars if needed. chrome=yes will ignore requests for standard toolbars like menubar, toolbar, location bar, bookmarks toolbar (personal bar) and status bar. E.g.: in Firefox 1.0, Tools/Options... creates a chrome window.
Supported in:
,
, ![]()
but not in NS 7.2, not in Firefox 1.0 and not in recent Mozilla release versions.
Note: Starting with Mozilla rv:1.2.1, this feature requires the UniversalBrowserWrite privilege (bug 180048).
If set to yes, the new window is said to be modal. The modal feature makes the new, secondary window stay on top/in front of its opener. Modal windows do not appear on the Windows task bar and can not be minimized on the Windows task bar. Another unrelated browser window may still be placed above the modal window.
The exact behavior of modal windows depends on the platform and on the Mozilla release version.
Early Mozilla release versions (Windows platform):
The modal window's opener can not be focused. A default beep (in NS 6.x, Netscape 7.0x and in some early Mozilla 1.x versions) arising from the Windows operating system will remind the user that he must dismiss the modal popup window first. Minimizing the modal window minimizes the opener as well.
Recent Mozilla release versions (Windows platform):
The modal window's opener can not be on top of the modal window but it can be focused and it can still operates (e.g.: one can click a link in the opener and the opener window will load the referenced resource). No default beep like in old release versions. The modal window can be minimized inside the opener viewport but not on the windows task bar.
The MSIE 6 almost equivalent to the modal feature can be obtained by the recourse of the method showModalDialog( ) (bug 194404).
Supported in:
,
,
,
, ![]()
By default, all new secondary windows have a titlebar. If set to no and if privileged security access is granted by the user, then this feature removes the titlebar from new secondary windows.
Mozilla and Firefox users can force new windows to always render the titlebar by setting
dom.disable_window_open_feature.titlebar
to true in about:config or in their user.js file.
Supported in:
,
,
,
, ![]()
If set to yes, the new window floats on top of, in front of any other browser windows, whether it is active or not. This feature requires enhanced privileged security access granted from the user.
At the time of writing this file, alwaysRaised feature is not supported when used in content script due to bug 274088; it works from chrome scripts though.
Supported in:
,
,
but not in NS 7.2
Supported in older
releases but not in recent Mozilla 1.x releases nor in Firefox 1.0.x.
If set to yes, the new created floats below, under its own parent when the parent window is not minimized. alwaysLowered windows are often referred as pop-under windows. The alwaysLowered window can not be on top of the parent but the parent window can be minimized. In NS 6.x, the alwaysLowered window has no minimize system command icon and no restore/maximize system command.
At the time of writing this file, alwaysLowered feature is not supported when used in content script due to bug 274088.
Supported in:
,
,
but not supported in NS 7.2
Supported in older
releases but not in recent Mozilla 1.x releases nor in Firefox 1.0.x.
Same as alwaysLowered. This feature requires privileged security access granted by the user. Its behavior is the same as alwaysLowered. Often referred as pop-under windows. A z-locked window can not be on top of its parent. In NS 6.x, the z-locked window has no minimize system command icon and no restore/maximize system command.
Supported in:
,
,
(but not supported in NS 7.2)
Supported in older
releases but not in recent Mozilla 1.x releases nor in Firefox 1.0.x.
When set to no, this feature removes the system close command icon and system close menu item. In NS 6.x, the close feature when set to no removes all command system icons and all command system menu without enhanced privileged abilities. Setting close=no requires both enhanced privileged abilities and dialog=yes feature in NS 7.x, Mozilla 1.x and Firefox 1.x. close=no will override minimizable=yes.
Supported in:
,
,
, ![]()
The position and size feature elements require a number to be set. The toolbars and window functionalities can be set with a yes or no; you can use 1 instead of yes and 0 instead of no. The toolbar and functionality feature elements also accept the shorthand form: you can turn a feature on by simply listing the feature name in the strWindowFeatures string. If you supply the strWindowFeatures parameter, then the titlebar, close and hotkeys are still yes by default, but the other features which have a yes|no choice will be no by default and will be turn off.
<script type="text/javascript">
var WindowObjectReference; // global variable
function openRequestedPopup()
{
WindowObjectReference = window.open("http://www.domainname.ext/path/ImageFilename.png",
"DescriptiveWindowName",
"width=420,height=230,resizable,scrollbars=yes,status=1");
}
</script>
In this example, the window will be resizable, it will render scrollbar(s) if needed, if the content overflows requested window dimensions and it will render the status bar. It will not render the menubar nor the location bar. Since the author knew about the size of the image (400 pixels wide and 200 pixels high), he added the margins applied to the root element in MSIE 6 which is 15 pixels for top margin, 15 pixels for the bottom margin, 10 pixels for the left margin and 10 pixels for the right margin.
<script type="text/javascript"> var WindowObjectReference; // global variable function openFFPromotionPopup() { if(WindowObjectReference == null || WindowObjectReference.closed) /* explanation: if the pointer to the window object in memory does not exist or if such pointer exists but the window was closed */ { WindowObjectReference = window.open("http://www.spreadfirefox.com/", "PromoteFirefoxWindowName", "resizable=yes,scrollbars=yes,status=yes"); } /* explanation: then create it. The new window will be created and will be brought on top of any other window. */ else { WindowObjectReference.focus(); }; /* explanation: else the window reference must exist and the window is not closed; therefore, we can bring it back on top of any other window with the focus() method. There would be no need to re-create the window or to reload the referenced resource. */ } </script> (...) <p><a href="http://www.spreadfirefox.com/" target="PromoteFirefoxWindowName" onclick="openFFPromotionPopup(); return false;">Promote Firefox adoption</a></p>
The above code solves a few usability problems related to links opening secondary window. The purpose of the return false in the code is to cancel default action of the link: if the onclick event handler is executed, then there is no need to execute the default action of the link. But if javascript support is disabled or non-existent on the user's browser, then the onclick event handler is ignored and the browser loads the referenced resource in the target frame or window that has the name "PromoteFirefoxWindowName". If no frame nor window has the name "PromoteFirefoxWindowName", then the browser will create a new window and will name it "PromoteFirefoxWindowName".
More reading on the use of the target attribute:
HTML 4.01 Target attribute specification
How to create a link that opens a new window?
You can also parameterize the function to make it versatile, functional in more situations, therefore re-usable in scripts and webpages:
<script type="text/javascript">
var WindowObjectReference; // global variable
function openRequestedPopup(strUrl, strWindowName)
{
if(WindowObjectReference == null || WindowObjectReference.closed)
{
WindowObjectReference = window.open(strUrl, strWindowName,
"resizable=yes,scrollbars=yes,status=yes");
}
else
{
WindowObjectReference.focus();
};
}
</script>
(...)
<p><a href="http://www.spreadfirefox.com/" target="PromoteFirefoxWindow"
onclick="openRequestedPopup(this.href, this.target); return false;">Promote Firefox adoption</a></p>
You can also make such function able to open only 1 secondary window and to reuse such single secondary window for other links in this manner:
<script type="text/javascript"> var WindowObjectReference; // global variable var PreviousUrl; /* global variable which will store the url currently in the secondary window */ function openRequestedSinglePopup(strUrl) { if(WindowObjectReference == null || WindowObjectReference.closed) { WindowObjectReference = window.open(strUrl, "SingleSecondaryWindowName", "resizable=yes,scrollbars=yes,status=yes"); } else if(previousUrl != strUrl) { WindowObjectReference = window.open(strUrl, "SingleSecondaryWindowName", "resizable=yes,scrollbars=yes,status=yes"); WindowObjectReference.focus(); /* explanation: if the resource to load is different, then we load it in the already opened secondary window and then we bring such window back on top/in front of its parent window. */ } else { WindowObjectReference.focus(); }; PreviousUrl = strUrl; /* explanation: we store the current url in order to compare url in the event of another call of this function. */ } </script> (...) <p><a href="http://www.spreadfirefox.com/" target="SingleSecondaryWindowName" onclick="openRequestedSinglePopup(this.href); return false;">Promote Firefox adoption</a></p> <p><a href="http://www.mozilla.org/support/firefox/faq" target="SingleSecondaryWindowName" onclick="openRequestedSinglePopup(this.href); return false;">Firefox FAQ</a></p>
How to prevent the message box asking the user if he wants to close the window?
You can not. New windows not opened by javascript can not as a rule be closed by javascript. The javascript console in Mozilla-based browsers will report the warning message:
"Scripts may not close windows that were not opened by script."
Otherwise the history of URLs visited during the browser session would be lost.
More on the window.close() method
How to bring back the window if minimized or if the window is behind another window?
First check for the existence of the window object reference of such window and if it exists and if it has not been closed, then use focus() method. There is no other reliable and efficient way. You can examine an example explaining how to use the focus() method.
How do I force a maximized window?
You can not. All browser manufacturers try to make the opening of new secondary windows noticed by users and noticeable by users to avoid confusion, to avoid disorienting users.
How do I turn off window resizability or remove toolbars?
You can not by force. Mozilla-based users can have absolute control over window functionalities (resizability and scrollability) and toolbars presence by editing user preferences in about:config or via advanced prefs. Since your users are the ones who are targeted to view and to use such windows (not you, the web author), then best is to avoid interfering with their habits and preferences. We recommend to always set the resizability and scrollbars presence (if needed) to yes to insure accessibility to content and usability of windows. This is in the best interests of both the web author and of users as well.
How to resize a window to fit its content?
You can not reliably because the users can prevent the window from being resized by unchecking the
Edit/Preferences/Advanced/Scripts & Plug-ins/Allow Scripts to/
Move or resize existing windows checkbox in Mozilla or
Tools/Options/Web Features/Enable Javascript/Advanced button/
Move or resize existing windows checkbox in Firefox or by setting
dom.disable_window_move_resize
to true in the about:config or by editing accordingly their user.js file. In general, users usually disable moving and resizing of existing windows because allowing authors' scripts to do so has been abused overwhelmingly in the past and the rare scripts that do not abuse such feature are often wrong, inaccurate when resizing the window. 99% of all those scripts disable window resizability and disable scrollbars when in fact they should enable both of these features to allow a cautious and sane fallback mechanism if their calculations are wrong. The window method sizeToContent() is also disabled if the user uncheck the preference Move or resize existing windows checkbox. Moving and resizing a window remotedly on the user's screen via script will very often annoy the users, will disorient the user and will be wrong at best. The web author expects he can have full control of (and can decide about) every position and size aspects of the users' browser window ... which is simply not true.
How do I open a referenced resource of a link into a new tab? or in a specific tab?
Currently, you can not. Only the user can set his advanced preferences to do that. K-meleon 1.1.2, a Mozilla-based browser, gives complete control and power to the user regarding how links are opened. Some advanced extensions also give Mozilla and Firefox a lot of power over how referenced resources are loaded.
In a few years from now, the target property of the CSS3 hyperlink module may be implemented (if CSS3 Hyperlink module as it is right now is approved). And even if and when such possibility happens, you can expect browser manufacturers and Mozilla browsers (and other browsers based on/offering tab-browsing) to give the user entire veto power and full control over how links can open web pages. How to open a link should always be entirely under the control and the power of the user.
How do I know if a window has opened, is still opened?
You can test for the existence of the window object reference which is the returned value in case of success of the window.open() call and then verify that WindowObjectReference.closed return value is false but this is not a reliable way to detect presence of an active popup blocking software.
Microsoft answers pretty much the same: How can I tell if Internet Explorer has blocked my pop-up window? Functions that return a window object will return null if the window is blocked. Always check the return value of window.open() before using it to avoid script errors when pop-ups are blocked.
quote from Finetune Your Web Site for XP SP2
What is the javascript relationship between the main window and the secondary window?
The return value of the window.open() method and the opener keyword. The WindowObjectReference links the main (opener) window to the secondary (sub-window) window while the opener keyword will link the secondary window to its main (opener) window.
I can not access the properties of the new secondary window. I always get an error in the javascript console saying "Error: uncaught exception: Permission denied to get property <property_name or method_name>". Why is that?
It is because of the cross-domain script security restriction (also referred as the "Same Origin Policy"). A script loaded in a window (or frame) from a distinct origin (domain name) cannot get nor set properties of another window (or frame) or the properties of any of its HTML objects coming from another distinct origin (domain name). Therefore, before executing a script targeting a secondary window, the browser in the main window will verify that the secondary window has the same domain name.
More reading on the cross-domain script security restriction:
http://www.mozilla.org/projects/security/components/same-origin.html
Generally speaking, it is preferable to avoid resorting to window.open() for several reasons:
If you want to offer to open a link in a new window, then follow tested and recommendable usability and accessibility guidelines:
Always identify links which will create (or will re-use) a new, secondary window in a way that helps navigation for users:
by coding the title attribute of the link, by adding an icon at the end of the link or by coding the cursor accordingly.
"if your link spawns a new window, or causes another windows to 'pop up' on your display, or move the focus of the system to a new FRAME or Window, then the nice thing to do is to tell the user that something like that will happen."
quote from World Wide Web Consortium Accessibility Initiative regarding popups
Using Link Titles to Help Users Predict Where They Are Going, Jakob Nielsen, January 1998"Use link titles to provide users with a preview of where each link will take them, before they have clicked on it."
quote from Ten Good Deeds in Web Design, Jakob Nielsen, October 1999
When extreme changes in context are explicitly identified before they occur, then the users can determine if they wish to proceed otherwise they can be prepared for the change: not only they will not be confused or feel disoriented, but more experienced users can better decide how to open such links (in a new window or not, in the same window, in a new tab or not, in "background" or not)."Users often don't notice that a new window has opened, especially if they are using a small monitor where the windows are maximized to fill up the screen. So a user who tries to return to the origin will be confused by a grayed out Back button."
quote from The Top Ten New Mistakes of Web Design: 2. Opening New Browser Windows, Jakob Nielsen, May 1999
DOM Level 0. window.open() is not part of any W3C specification or technical recommendation.
In cases where left and screenX (and/or top and screenY) have conflicting values, then left and top have precedence over screenX and screenY respectively. If left and screenX (and/or top and screenY) are defined in the strWindowFeatures list, then left (and/or top) will be honored and rendered. E.g.:
WindowObjectReference = window.open("http://news.bbc.co.uk/", "BBCWorldNewsWindowName",
"left=100,screenX=200,resizable,scrollbars,status");
Result: here, the new window will be positioned at 100 pixels from the
left side of the work area for applications of the user's operating
system, not at 200 pixels.
If left is set but top has no value and screenY has a value, then left and screenY will be the coordinate positioning values of the secondary window.
outerWidth has precedence over width and width has precedence over innerWidth.
outerHeight has precedence over height and height has precedence over innerHeight.
Example:
WindowObjectReference = window.open("http://www.wwf.org/",
"WWildlifeOrgWindowName",
"outerWidth=600,width=500,innerWidth=400,resizable,scrollbars,status");
Result: here, Mozilla-browsers will create a new window with an outerWidth
of 600 pixels wide and will ignore the request of a width of 500 pixels
and will also ignore the request of an innerWidth of 400 pixels.
Requested position and requested dimension values in the strWindowFeatures list will not be honored and will be corrected if any of such requested value does not allow the entire browser window to be rendered within the work area for applications of the user's operating system. No part of the new window can be initially positioned offscreen. This is by default in all Mozilla-based browser releases.
MSIE 6 SV1 has a similar error correction mechanism but it is not activated by default in all security levels: a security setting can disable such error correction mechanism.
When content overflows window viewport dimensions, then scrollbar(s) (or some scrolling mechanism) are necessary to insure that content can be accessed by users. Content can overflow window dimensions for several reasons which are outside the control of web authors:
You should assume that a large majority of users' browsers will have the status bar or that a large majority of users will want to force the status bar presence: best is to always set this feature to yes. Also, if you specifically request to remove the status bar, then Firefox users will not be able to view the Site Navigation toolbar if it is installed. In Mozilla and in Firefox, all windows with a status bar have a window resizing grippy
at its right-most side. The status bar also provides info on http connection, hypertext resource location, download progress bar, encryption/secure connection info with SSL connection (displaying a yellow padlock icon), internet zone icons, privacy policy/cookie icon, etc. Removing the status bar usually removes a lot of functionalities, features and info which are considered useful and sometimes vital by the users and for the users.
in MSIE 6 for XP SP2:
"For windows opened using window.open():
Expect the status bar to be present, and code for it. The status bar will be on by default and is 20-25 pixels in height. (...)"
quote from Fine-Tune Your Web Site for Windows XP Service Pack 2, Browser Window Restrictions in XP SP2
"(...) windows that are created using the window.open() method can be called by scripts and used to spoof a user interface or desktop or to hide malicious information or activity by sizing the window so that the status bar is not visible.
Internet Explorer windows provide visible security information to the user to help them ascertain the source of the Web page and the security of the communication with that page. When these elements are not in view, the user might think they are on a more trusted page or interacting with a system process when they are actually interacting with a malicious host. (...)
Script-initiated windows will be displayed fully, with the Internet Explorer title bar and status bar. (...)
Script management of Internet Explorer status bar
Detailed description
Internet Explorer has been modified to not turn off the status bar for any windows. The status bar is always visible for all Internet Explorer windows. (...) Without this change, windows that are created using the window.open() method can be called by scripts and spoof a user interface or desktop or hide malicious information or activity by hiding important elements of the user interface from the user.
The status bar is a security feature of Internet Explorer windows that provides Internet Explorer security zone information to the user. This zone cannot be spoofed (...)"
quote from Changes to Functionality in Microsoft Windows XP Service Pack 2, Internet Explorer Window Restrictions
In MSIE 6 for XP SP2:
"window.open() with fullscreen=yes will now result in a maximized window, not a kiosk mode window."
quote from From Fine-Tune Your Web Site for Windows XP Service Pack 2.
"the definition of the fullscreen=yes specification is changed to mean 'show the window as maximized,' which will keep the title bar, address bar, and status bar visible. (...)"
quote from Changes to Functionality in Microsoft Windows XP Service Pack 2, Script sizing of Internet Explorer windows

Javascript windows (tutorial) by Lasse Reichstein Nielsen
The perfect pop-up (tutorial) by accessify.com
Popup windows and Firefox: interactive demos by Gérard Talbot
Links Want To Be Links by Jukka K. Korpela
Links & JavaScript Living Together in Harmony by Jeff Howden