asp.net.ph

Skip Navigation Links

open Method

DHTML Methods


Opens a new window and loads the document given by sURL, or opens a blank document if a URL is not provided.

Syntax

oNewWindow = window.open ( [  sURL  ] [ , sName  ] 
   [ , sFeatures ] [ , bReplace  ] ) 
Parameters

sURL Optional. URL of the document to display. If no URL is specified, a new window with about:blank will be displayed.
sName Optional. Name of the window. This name is used as the value for the target on a FORM or an A.

In Internet Explorer® 5 or later, specifying the value _search will open sURL in the browser's search pane.
sFeatures Optional. Window ornaments to display. The following table lists the supported features.

channelmode = { yes | no | 1 | 0 } Specifies whether to display the window in theater mode and show the channel band.
dependent = { yes | no | 1 | 0 } In Microsoft® Internet Explorer® version 5 or later, specifying the value yes creates a window with a subset of window characteristics. The default is no.

A dependent window has the following characteristics:
  • The dependent window closes at the same time that the parent window is closed.
  • The window title bar has no Minimize or Maximize button, no icon, and no Close button.
  • The window does not display a system menu.
  • The window does not appear on the taskbar or the list of open applications and windows that pops up when the user presses ALT+TAB.
directories = { yes | no | 1 | 0 } Specifies whether to add directory buttons. The default is yes.
fullscreen = { yes | no | 1 | 0 } Specifies whether to display the browser in a full-screen or normal window. The default is no, which displays the browser in a normal window.

Use full-screen mode carefully. Because this mode hides the browser's title bar and menus, you should always provide a button or other visual clue to help the user close the window. ALT+F4 will also close the new window.
height = number Specifies the height of the window, in pixels. The minimum value should be 100.
left = number Specifies the left position, in pixels. This value is relative to the upper-left corner of the screen.
location = { yes | no | 1 | 0 } Specifies whether to display the input field for entering URLs directly into the browser.
menubar = { yes | no | 1 | 0} Specifies whether to display the menu bar. The default is yes.
resizable = { yes | no | 1 | 0} Specifies whether to display resize handles at the corners of the window.
scrollbars = { yes | no | 1 | 0} Specifies whether to display horizontal and vertical scroll bars. The default is yes.
status = { yes | no | 1 | 0 } Specifies whether to add a status bar at the bottom of the window. The default is yes.
titlebar = { yes | no | 1 | 0 } Specifies whether to display a title bar for the window. This parameter is ignored unless the caller is an HTML Application or a trusted dialog. The default is yes.
toolbar = { yes | no | 1 | 0 } Specifies whether to display the browser toolbar, making buttons such as Back, Forward, and Stop available.
top = number Specifies the top position, in pixels. This value is relative to the upper-left corner of the screen.
width = number Sets the width of the window, in pixels. The minimum value should be 100.

bReplace Optional. Value that specifies whether the URL that is 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 set to true, no new history entry is created.

Return Value

Returns a reference to the new window object. Use this reference to script properties and methods on the new window.

Remarks

By default, the open method creates a window that has a default width and height and the standard menu, toolbar, and other features of Internet Explorer. You can alter this set of features by using the sFeatures parameter. This parameter is a string consisting of one or more feature settings.

Example

The following example creates a new window that contains the file sample.html. The new window is 300 by 500 pixels and has a status bar, but it does not have a toolbar, menu bar, or address field.

window.open ( "sample.aspx", null, 
   "height=300, width=500, status=yes, toolbar=no, menubar=no, location=no" );

 Show me 

Applies To

window

See Also

opener Property, close Method, closed Property



© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note