-
Opens a new window and loads the document specified by the given URL.
What's the news from Microsoft? Internet Explorer 6
Starting with Internet Explorer 6, the _media value of the sName parameter specifies that this method loads the URL into the HTML content area of the media bar.
syntax
one ww window = window . open([sURL][,sName] [,sFeatures] [,bReplace])
factor
SURL is optional. A string that specifies the URL of the document to be displayed. If no URL is specified, a new window with about:blank will be displayed.
SName optional. A string that specifies the name of the window. This name is used as the value of the target attribute on the form or a element. _ blanksur is loaded into a new unnamed window.
_ Media sURL is loaded into the HTML content area of the media bar. Available in Internet Explorer 6 or later.
_ parentsul is loaded into the parent frame of the current frame. If the frame has no parent frame, the value acts as value _self.
_ provide search function in Internet Explorer 5 and later. SURL opens in the search pane of the browser.
_self replaces the current document with the specified sURL.
_top sURL replaces any frameset that may be loaded. If no frameset is defined, this value will be taken as value _self.
S function is optional. The string parameter is a comma-separated list of items. Each item consists of an option and a value, separated by an equal sign (for example, "Full Screen = Yes, Toolbar = Yes"). The following functions are supported. Channel mode = {yes | no |1| 0} specifies whether to display the window in cinema mode and display the channel band. The default is no.
Directory = {yes | no | 1 | 0} Specifies whether to add a directory button. The default value is Yes.
Fullscreen = {yes | no | 1 | 0} Specifies whether to display the browser in full screen mode. The default is no. Please use full screen mode carefully. Because this mode hides the title bar and menu of the browser, you should always provide a button or other visual clue to help users close the window. ALT+F4 closes the new window. Windows in full screen mode must also be in channelmode.
Height = number Specifies the height of the window in pixels. The minimum value is 100.
Left = number specifies the left position, in pixels. This value is relative to the upper left corner of the screen. The value must be greater than or equal to 0.
Location = {yes | no | 1 | 0} Specifies whether to display the input field for directly entering the URL in the browser. The default value is Yes.
Menubar = {yes | no | 1 | 0} Specifies whether to display the menu bar. The default value is Yes.
Resizable = {yes | no | 1 | 0} Specifies whether resize handles are displayed in the corners of the window. The default value is Yes.
Scrollbars = {yes | no | 1 | 0} Specifies whether to display horizontal and vertical scroll bars. The default value is Yes.
Status = {yes | no | 1 | 0} Specifies whether to add a status bar at the bottom of the window. The default value is Yes.
Titlebar = {yes | no | 1 | 0} Specifies whether to display the title bar of the window. This parameter is ignored unless the calling application is an HTML application or a trusted dialog box. The default value is Yes.
Toolbar = {yes | no | 1 | 0} Specifies whether to display the browser toolbar, so that buttons such as Back, Forward and Stop are available. The default value is Yes.
Top = number specifies the top position, in pixels. This value is relative to the upper left corner of the screen. The value must be greater than or equal to 0.
Width = number Sets the width of the window in pixels. The minimum value is 100.
Br substitution is optional. When sURL is loaded into the same window, this Boolean parameter specifies whether sURL creates a new entry or replaces the current entry in the window history list. If true, replace the current document in the history list.
False sURL creates a new entry in the history list.
Return value
Returns a reference to a new window object. Use this reference to access properties and methods in a new window.
comment
By default, the window created by the open method has the default width and height, as well as the standard menus, toolbars and other functions of Internet Explorer. You can use the sFeatures parameter to change this set of functions. This parameter is a string consisting of one or more function settings.
When you specify the sFeatures parameter, features that are not defined in the parameter are disabled. Therefore, when using the sFeatures parameter, all the functions contained in the new window must be enabled. If the sFeatures parameter is not specified, the window function will remain at its default value. In addition to enabling a property by setting it to a specific value, simply listing the property name can also enable the property for a new window.
Internet Explorer 5 allows you to further control windows by implementing title in the sFeatures parameter of the open method. By downloading from trusted applications such as Microsoft Visual Basic? Or an HTML application (HTA). These applications are considered trustworthy because they all use the Internet Explorer interface instead of the browser.
When a function triggered by an event on any object calls the open method, the window.open method is implicit.
Show examples
& ltSCRIPT LANGUAGE="JScript " >
Function foo() {
Open ("About: Blank"); }
& lt/SCRIPT & gt;
& ltBODY onclick = " foo();" & gt
Click this page to call window.open ().
& lt/BODY & gt;
When an event on any object calls the open method, the document.open method is implicit.
& ltBUTTON onclick = " open(' sample . htm ');" & gt
Click this button to call document.open ().
& lt/BUTTON & gt;
example
This example uses the open method to create a new window containing Sample.htm. The new window is 200 pixels by 400 pixels and has a status bar, but no toolbar, menu bar or address bar.
window.open("Sample.htm ",null,
"Height =200, Width =400, Status = Yes, Toolbar = No, Menu Bar = No, Position = No");