Opens a new Web browser window.

Syntax

JSV_openWindow(winName [, winURL, winAttributes, winReplace, winOptions...])

JSV_openWindow(winName, winURL) (see Remarks)

JSV_openWindow(winName) (see Remarks)

Returns

Returns true if the window is opened, or false if no window name was passed.

Parameters

The openWindow function uses the following arguments.

Argument Description
winName This is the target name of the new window. A string specifying the window name to use in the TARGET attribute of a FORM or A tag. winName can contain only alphanumeric or underscore (_) characters. Used to load another document into the window with JSV_openWindow or manipulate the document/window with other JavaScript Vision window management functions.
winURL Optional. A string specifying the relative or absolute URL of the file to be loaded into the pop-up window. See the Location object for a description of the URL components.
winAttributes

Optional. A string containing a comma-separated list determining whether or not to create various standard window features.

This parameter can hold a large selection of name-value pairs:

Nav2.0+ValueDescription
directories Boolean Controls the standard browser directory buttons
height numeric Specifies the height of the window in pixels
location Boolean Controls the Location entry field
menubar Boolean Controls the menu at the top of the window
resizable Boolean Controls the ability to resize the window
scrollbars Boolean Controls the horizontal and vertical scrollbars
status Boolean Controls the status bar at the bottom of the window
toolbar Boolean Controls the standard browser toolbar
width numeric Specifies the width of the window in pixels

If you don't specify the width or height values, then Netscape browsers will mimic the size of the current window, if you don't specify any attributes then Netscape will mimic all the features of the current window.

Both Nav4 and IE4 introduced new window features that can be set when opening up a new window:

Nav4.0+ValueDescription
alwaysLowered Boolean Creates a new window that floats below other windows, whether it is active or not. This is a secure feature and must be set in signed scripts.
alwaysRaised Boolean Creates a new window that floats on top of other windows, whether it is active or not. This is a secure feature and must be set in signed scripts.
dependent Boolean Creates a new window as a child of the current window. A dependent window closes when its parent window closes. On Windows platforms, a dependent window does not show on the task bar.
hotkeys Boolean Disables most hotkeys in a new window that has no menu bar. The security and quit hotkeys remain enabled.
innerHeight numeric Specifies the height, in pixels, of the window's content area. To create a window smaller than 100 x 100 pixels, set this feature in a signed script. This feature replaces height, which remains for backwards compatibility.
innerWidth numeric Specifies the width, in pixels, of the window's content area. To create a window smaller than 100 x 100 pixels, set this feature in a signed script. This feature replaces width, which remains for backwards compatibility.
outerHeight numeric Specifies the vertical dimension, in pixels, of the outside boundary of the window. To create a window smaller than 100 x 100 pixels, set this feature in a signed script.
screenX numeric Specifies the distance the new window is placed from the left side of the screen. To place a window offscreen, set this feature in a signed scripts.
screenY numeric Specifies the distance the new window is placed from the top of the screen. To place a window offscreen, set this feature in a signed scripts.
titlebar Boolean Creates a window with a title bar. To set the titlebar to no, set this feature in a signed script.
z-lock Boolean Creates a new window that does not rise above other windows when activated. This is a secure feature and must be set in signed scripts.
IE4.0+ValueDescription
fullscreen Boolean Specifies whether to display the browser in a full-screen or normal window.
channelmode Boolean Specifies whether to display the window in theater mode and show the channel band.
top numeric Specifies the distance the new window is placed from the top of the screen.
left numeric Specifies the distance the new window is placed from the left side of the screen.

Many of these features (as noted above) can either be yes or no. For these features, you can use 1 instead of yes and 0 instead of no. If you want to turn a feature on, you can also simply list the feature name in the winAttributes string.

If winName does not specify an existing window and you do not supply the winAttributes parameter, all of the features which have a yes/no choice are yes by default. However, if you do supply the winAttributes parameter, then the titlebar and hotkeys are still yes by default, but the other features which have a yes/no choice are no by default.

winReplace Optional. The fourth parameter is a Boolean value, either true (set this to true only if using Navigator 3+ or Internet Explorer 4+) or false. If true, then the current history entry is replaced with the new page being loaded (i.e., the last location in the browser's history object is overwritten by the new location). Default value is false.
winOptions

Optional. Currently only one value can be specified.

ValueDescription
CLOSEBEFOREPARENT Use in conjunction with JSV_hyperLink and JSV_onSubmit to ensure that the child window is manually closed by the user before the parent window is exited either by the user clicking a hyperlink on the page or by form submission.

Remarks

Similar to the open method of window but used within the context of JavaScript Vision window management (i.e., the windows are managed using the window name versus the window handle).

JSV_openWindow(winName, winURL)
Use this format of JSV_openWindow, after the window has been defined using JSV_openWindow or JSV_defineWindow, to open the named window with a different URL than the window was originally defined with.

var myWindow = "JSV_Test";
var wasOpened =
    JSV_defineWindow(myWindow,
    'http://www.infoseek.com/',
    'status=1,scrollbars=1,resizable=1,width=580,height=240,left=40,top=40,screenX=40,screenY=40');
var wasOpened = JSV_openWindow(myWindow, 'http://www.builder.com/');

JSV_openWindow(winName)
Use this format of JSV_openWindow, after the window has been defined using JSV_openWindow or JSV_defineWindow, to open the named window with the URL that was used when the window was originally defined.

var myWindow = "JSV_Test";
var wasOpened =
    JSV_defineWindow(myWindow,
    'http://www.infoseek.com/',
    'status=1,scrollbars=1,resizable=1,width=580,height=240,left=40,top=40,screenX=40,screenY=40');
var wasOpened = JSV_openWindow(myWindow);

If the window has not been defined with JSV_defineWindow, then JSV_openWindow defines the window and makes the new window available to other JavaScript Vision window management functions.

Dependencies

JSV_isWhitespace

Example

The following lines of code

function windowTest() {
    var myWindow = "JSV_Test";
    var wasOpened =
        JSV_openWindow(myWindow,
        'testpage.htm',
        'status=1,scrollbars=1,resizable=1,width=580,height=240,left=40,top=40,screenX=40,screenY=40');
}

produce a new window when the button is clicked