JavaScript introduction 2 Original: Onefi page is built on the window, anything about the web page is related to the window. Let us first let us familiarize with the basic structure of Internet Explorer. Under normal circumstances, the open window has the following four parts:
Title Bar: The window displays the local control area of the title: Various buttons, menu windows: The biggest part on the browser, don't say more! Status bar (Status): Displays the appropriate system information and where JavaScript information is displayed by default, the open new window contains the above part. But when you use Windows.Open (), we can control the style of the newly opened window. grammar:
OnewDoc = Document.open (SURL [, SNAME] [, SFEATURES] [, BREPLACE]) Description:
SURL
Optional. String - Specify the URL address of the new document. If this is not specified, it will be an empty (about: blank).
Sname
Optional. String - the name of the new generation window. It can be used as a value of Target in Form or A.
Blank
SURL is loaded into a new unnamed window.
_MEDIA
SURL is loaded into a media bar. (Only for IE6 and later browser)
_Parent
SURL is loaded on the upper frame of the current frame. If there is no upper layer frame, the value of this item is the same as _self.
_Search
SURL is opened in the browser's lookup window. (Only for IE5 and later browser)
_Self
SURL opens on the current window to overwrite the previous content.
_top
SURL may be loaded on the Frameset if there is no define frameset, which is the same as _self.
SFEATURES
Optional. String - lists the object table and separated by comma. Every item has its own value, they will be separated (such as "fulscreen = yes, toolbar = yes"). The following is a supported feature. ChannelMode = {YES | NO | 1 | 0} Whether the step mode is displayed in the window. The default is NO. Directories = {YES | NO | 1 | 0} Whether to display various buttons in the window. Default is YES. Fullscreen = {YES | NO | 1 | 0} Show browsers in full screen. The default is NO. It is very careful when using this feature. Because this property may hide the browser's title bar and menu, you must provide a button or other tip to help the user closes this browsing window. Alt F4 can close the window. A full screen window must use the ChannelMode mode. Height = NUMBER Specifies the height of the window, the unit is pixel. The minimum is 100. LEFT = Number Specifies the distance from the left frame from the left frame, and the unit is pixel. The value must be greater than or equal to 0. Location = {YES | NO | 1 | 0} Specifies whether to display the address bar in the window. Default is YES. MenuBar = {YES | NO | 1 | 0} Specifies whether to display the menu bar in the window. Default is YES. ResizAble = {yes | no | 1 | 0} Specifies whether to display the handle for the user to adjust the size in the window. Default is YES. Scrollbars = {YES | NO | 1 | 0} Specifies whether to display the lateral or vertical scroll bar in the window. Default is YES. Status = {YES | NO | 1 | 0} Specifies whether to display the status bar in the window. Default is YES. Titlebar = {YES | NO | 1 | 0} Specifies whether to display the title bar in the window. This will be ignored if the HTML Application or a dialog is not called. Default is YES. Toolbar = {YES | NO | 1 | 0} Specifies whether to display the toolbar in the window, including the button such as advance, back, stop, etc. Default is YES. TOP = Number Specifies the location at the top of the window, and the unit is pixel. The value must be greater than or equal to 0. Width = Number Specifies the width of the window, the unit is pixel. The minimum is 100. BREPLACE
Optional. When the SURL is loaded into the same window, this Boolean variable specifies whether this SURL creates an entry or adds to the history of the current window.
True
SURL overrides the historical record of current documentation.
False
SURL creates a new entry in history. Note:
By default, the Open method establishes a window with default width, height, menu, and toolbar. You can specify any one or more feature parameters. These parameters are composed of one or more strings.
Once the feature parameters are specified, other other feature parameters that are not specified are all disabled. Therefore, when the feature parameters are used, you need to define all other feature parameters that need to be used in the window. If the feature parameters are not specified, all features will be retained the original default. In addition to specifying a new value to the feature parameter, a simple column feature name can be valid for the corresponding feature of the window.
Example:
Window.open ("Sample.htm", NULL, "Height = 200, Width = 400, Status = YES, Toolbar = NO, MENUBAR = No, Location = no"); in the example, a set of Sample.htm is established New window. This new window has 200 pixels wide and 400 pixels, with a status bar, but there is no toolbar, menu bar, and address bar. The above is the corresponding code. A more complete example is given below for the generation of the new window.