window.open Detailed:
window.open ("sURL", "sname", "Sfeature", "breplace");
sURL: Options available. String. Specifies 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: Options available. 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 generic name: _media:ie6.0 Open sURL in the media panel on the left side of the browser.
_blank: Open surl in New window.
_parent: Open within the parent frame of the current frame. This parameter value is equivalent to _self if the current frame has no parent frame.
_search:ie5.0 opens sURL in the search panel on the left side of the browser.
_self:surl opens in the current window, overwriting the current document.
_top: Open sURL in the topmost window outside all frames. If the current window has no frame structure, this parameter value is equivalent to _self.
Sfeatures: Options available. String. Specifies the window decoration style. Use the following values. Multiple partitions are separated by commas. The setting of this parameter will only work if a new browser window is established. CHANNELMODE={YES|NO|1|0} Specifies whether to display the window as channel mode. The default value is No.
DIRECTORIES={YES|NO|1|0} Specifies whether the link button is displayed. The default value is yes.
FULLSCREEN={YES|NO|1|0} Specifies whether the window is displayed in Full-screen mode. The default value is No. Be careful with Full-screen mode, because this pattern hides the title bar and menu of the browser window. If you do not have the ability to close the window 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 horizontal axis of the upper-left corner of the window relative to the desktop. The unit is in pixels (px).
Width=number sets the width of the window. The minimum value is 100.
Top=number sets the vertical axis of the upper-left corner of the window relative to the desktop. The unit is in pixels (px).
LOCATION={YES|NO|1|0} Sets whether the address bar of the browser window is displayed. The default value is yes.
MENUBAR={YES|NO|1|0} Sets whether the menu bar for the browser window is displayed. The default value is yes.
RESIZABLE={YES|NO|1|0} Sets whether the window allows the user to resize. 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 the status bar for the browser window is displayed. The default value is yes.
TITLEBAR={YES|NO|1|0} sets whether the title bar of the browser window is displayed. This parameter is 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 the toolbar for the browser window is displayed. The default value is yes.
Breplace: Options available. A Boolean value (Boolean). False|true. False: The new open document overwrites the current document in the History list. True: The newly opened document is simply added to the end of the history list.
return value:
Onewwindow: Object (Element). Returns a reference to the new Window object.
--------------------------------------------------------------------------------------------------------------- ----
Method:
1: Click on the parent page test.aspx <input type= "button" id= "Btnshow" onclick= "ShowItem" (); " Value= the "Show subform"/> button to trigger, and then:
<script language= "javascript" type= "Text/javascript" >
function ShowItem () {
var win = window.open ("test2.aspx", NULL, "height=300,width=450, left=300px,top=20px, Menubar=no,titlebar=no, Scrollbar=no,toolbar=no, Status=no,location=no ");
}
2: Click on the child page test2.aspx <input type= "button" id= "Btnselect" onclick= "check ();" Value= the "Select"/> button to trigger, and then:
<script language= "javascript" type= "Text/javascript" >
function Check () {
Window.opener.document.getElementById ("txtID"). Value=id;
Window.opener.document.getElementById ("Txtname"). Value=name;
}
In this way, the document.getElementById ("txtID") and document.getElementById ("Txtname") 2 controls of the parent page can get the return value of the child page.
This article for learning to share, please respect original, original address: http://blog.csdn.net/xmwangtiger/article/details/4234054