JavaScript New window and child window transfer value detailed _javascript skill

Source: Internet
Author: User
window.open () Support environment: javascript1.0+/jscript1.0+/nav2+/ie3+/opera3+
window.open (Pageurl,name,parameters)
Pageurl as a child window path
Name pop-up window
Parameters for window parameters (comma-separated arguments)
alwayslowered | yes/no | Specifies that the window is hidden behind all windows
alwaysraised | yes/no | Specifies that the window is suspended above all windows
depended | yes/no | Whether to close the parent window at the same time
Directories | yes/no | Whether the NAV2 and 3 columns are visible
Height | Pixel value | Window height
hotkeys | yes/no | Set up a secure exit hotkey in a window without a menu bar
Innerheight | Pixel value | Pixel height of the document in the window
Innerwidth | Pixel value | Pixel width of the document in the window
Location | yes/no | Whether the position bar is visible
MenuBar | yes/no | Whether the menu bar is visible
Outerheight | Pixel value | Set the pixel height of a window (including a decorative border)
Outerwidth | Pixel value | Set the pixel width of a window (including a decorative border)
resizable | yes/no | Whether the window size can be adjusted
ScreenX | Pixel value | The pixel length of the window from the left edge of the screen
ScreenY | Pixel value | The pixel length of the window from the edge of the screen
ScrollBars | yes/no | Whether a window can have a scroll bar
TitleBar | yes/no | Whether the window topic bar is visible
Toolbar | yes/no | Whether the window toolbar is visible
Width | Pixel value | The pixel width of the window
Z-look | yes/no | Whether the window floats on top of other windows when it is activated
Copy Code code as follows:

<pre code_snippet_id= "182098" snippet_file_name= "blog_20140210_1_6035784" name= "code" class= "JavaScript" > <SCRIPT>
window.open (' page.html ', ' newwindow ', ' Height=100,width=400,top=0,left=0,toolbar=no,menubar=no,scrollbars=no, Resizable=no,location=no, Status=no ')
</SCRIPT> </pre>
<pre></pre>
<pre></pre>
<pre></pre>

Vreturnvalue = window.showModalDialog (sURL [, varguments] [, Sfeatures])
Vreturnvalue = Window.showmodelessdialog (sURL [, varguments] [, Sfeatures])
sURL required parameter, type: String. The URL used to specify the document to display in the dialog box.
Varguments optional parameter, type: Variant. Used to pass parameters to the dialog box. The parameter types passed are not limited, including arrays, and so on. dialog box is passed
Sfeatures optional parameter, type: String. Used to describe information such as the appearance of a dialog box, you can use one or more of the following, with a semicolon ";" Separated.
Window.dialogarguments to get the parameters passed in.

1.dialogHeight: Dialog height, not less than 100px,ie4 dialogheight and dialogwidth default unit is EM, and IE5 is PX, in order to facilitate its see, in the Definition of modal dialog box, with PX to do units.
2.dialogWidth: Dialog box width.
3.dialogLeft: The distance from the left of the screen.
4.dialogTop: The distance from the screen.
5.center: {yes | no | 1 | 0}: The window is centered, the default yes, but the height and width can still be specified.
6.help: {yes | no | 1 | 0}: Show Help button, default yes.
7.resizable: {yes | no | 1 | 0} [ie5+]: can be changed size. Default No.
8.status: {yes | no | 1 | 0} [ie5+]: Whether the status bar is displayed. Default is yes[Modeless] or no[modal].
9.scroll:{Yes | no | 1 | 0 | on | off}: Indicates whether the dialog box displays scroll bars. The default is yes.
The following attributes are used in an HTA and are generally not used in general Web pages.
10.dialoghide:{Yes | no | 1 | 0 | on | off}: Dialog box is hidden when printing or printing preview. The default is No.
11.edge:{Sunken | raised}: Indicates the border style of the dialog box. Default is raised.
12.unadorned:{Yes | no | 1 | 0 | on | off}: default is No.

Parent.htm
Copy Code code as follows:

<pre code_snippet_id= "182098" snippet_file_name= "blog_20140210_2_3894881" name= "code" class= "JavaScript" > <script>
var obj = new Object ();
Obj.name= "51js";
window.showModalDialog ("modal.htm", obj, "dialogwidth=200px;dialogheight=100px");
</script>
Modal.htm
<script>
var obj = window.dialogarguments
Alert ("The parameter you passed is:" + obj.name)
</script></pre><p></p>
<pre></pre>
<p></p>
<p>//-------------------------------<br>
2. You can return information by Window.returnvalue to the window that opens the dialog box, or you can also be an object. such as:<br>
------------------------------</p>
<p></p><pre code_snippet_id= "182098" snippet_file_name= "blog_20140210_3_4734696" name= "code" class= "JavaScript" >//parent.htm
<script>
Str =window.showmodaldialog ("modal.htm", "dialogwidth=200px;dialogheight=100px");
alert (str);
</script>
Modal.htm
<script>
Window.returnvalue= "http://www.bokee.com";
</script></pre><br>
<br>
<p></p>
<p>1. Jump directly to <br> in the original form
window.location.href= "The page you want to jump";<br>
2, open the page in the new form with:<br>
window.open (' You want to jump to the page ');</p>
<p><span style= "color: #ff0000" >window.history.back (-1); Back to previous page </span></p>
<p><span style= "color: #ff0000" ><br>
</span></p>
<p><span style= "color: #ff0000" ><br>
</span></p>
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.