Home > Web Front-end > JS Tutorial > Detailed explanation of js pop-up window return value (window.open method)_javascript skills

Detailed explanation of js pop-up window return value (window.open method)_javascript skills

WBOY
Release: 2016-05-16 17:04:14
Original
2225 people have browsed it

test.php

复制代码 代码如下:
























test2.php
复制代码 代码如下:





















Detailed explanation of window.open

window.open("sUrl","sName","sFeature","bReplace");

sUrl: optional. String. Specify the URL address of the HTML document to be loaded. If no value is specified, a new window for about:blank will be displayed.

sName: optional. String. Specifies the name of the open window. This name can be used for the TARGET attribute of a form or a object. This name can also use the following common name: _media:IE6.0 Open sUrl in the media panel on the left side of the browser.

_blank: Open sUrl in a new window.
_parent: Open within the parent frame of the current frame. If the current frame has no parent frame, this parameter value is equivalent to _self.
_search: IE5.0 opens sUrl in the search panel on the left side of the browser.
_self:sUrl ​​opens in the current window, covering the current document.
_top: Opens sUrl in the topmost window outside all frames. If the current window has no frame structure, this parameter value is equivalent to _self.

sFeatures: Optional. String. Specifies the window decoration style. Use the values ​​below. Separate multiple entries with commas. The setting of this parameter will only take effect when a new browser window is created. channelmode={yes|no|1|0} specifies whether to display the window in channel mode. The default value is no.

directories={yes|no|1|0} specifies whether to display the "Link" button. The default value is yes.
fullscreen={yes|no|1|0} specifies whether to display the window in full screen mode. The default value is no. Be careful when using full-screen mode, as this mode hides the browser window's title bar and menus. If the function of closing the window is not provided on the page, the user can use the ALT F4 shortcut key to close the window.
height=number sets the height of the window. The minimum value is 100.
left=number sets the abscissa coordinate of the upper left corner of the window relative to the desktop. The unit is pixel (px).
width=number sets the width of the window. The minimum value is 100.
top=number sets the vertical coordinate of the upper left corner of the window relative to the desktop. The unit is pixel (px).
location={yes|no|1|0} sets whether to display the address bar of the browser window. The default value is yes.
menubar={yes|no|1|0} sets whether to display the menu bar of the browser window. The default value is yes.
resizable={yes|no|1|0} Sets whether the window is allowed to be resized by the user. The default value is yes.
scrollbars={yes|no|1|0} Sets whether the window can have scroll bars. The default value is yes.
status={yes|no|1|0} sets whether to display the status bar of the browser window. The default value is yes.
titlebar={yes|no|1|0} sets whether to display the title bar of the browser window. This parameter will be ignored unless the calling program is an HTML application (HTA) or a trusted dialog box. The default value is yes. toolbar={yes|no|1|0} sets whether to display the toolbar of the browser window. The default value is yes.
bReplace: optional. Boolean. false|true. false: The newly opened document overwrites the current document in the history list. true: Newly opened documents are simply added to the end of the history list.

Return value:
oNewWindow: Object (Element). Returns a reference to the new window object.

Instructions:
Open a new window and load the HTML document specified by sUrl. By default, the new window created by this method has default height, width, menu, toolbar, etc. You can change their settings using the sFeatures parameter.

When the sFeatures parameter is specified, decorative styles that do not appear in the parameter value list will be automatically set to no.

IE5 allows controlling the title bar of an open window. The title bar can be closed by opening a window in a trusted program like Microsoft® Visual Basic or HTML Application (HTA). They are trustworthy because they use Microsoft Internet Explorer as the browser interface.

When the function triggered by an event on the object in the document calls the open method, the open method of the window object is used. When the event on the object in the document directly uses the open method, the open method of the document object is used.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template