A simple example of how JavaScript implements the values of child parent forms

Source: Internet
Author: User

  This article is mainly on the JavaScript implementation of the child parent form of a simple example of the value of the introduction, the need for friends can come to the reference, I hope to help you.

window.showModalDialog () Use method:   var returnvalue = window.showmodaldialog (URL [, arguments] [, features]);   URL  --required parameter, type: String that specifies the URL   arguments  --optional parameter of the document to display in the dialog box, type: Variant, which is used to pass parameters to the dialog box, pass the parameter types, including arrays, etc. dialog box through window.dialogarguments to get the passed in parameters   features  --optional parameters, type: string, used to describe the appearance of the dialog box information, you can use the following one or several, with semicolons ";" Separated   dialogheight: dialog height, not less than 100px dialogwidth: Dialog width dialogleft: Distance from screen to left dialogtop: distance from screen center:{Yes | no | 1 | 0}: Yes No center, default Yes, but can still specify height and width    help:{yes | no | 1 | 0}: Show Help button, default Yes Resizable:{yes | no | 1 | 0} [ie5+]: can be changed to size No Status:{yes | no | 1 | 0} [ie5+]: Whether to display the status bar, default to yes[Modeless] or No[modal] scroll:{yes | no | 1 | 0 | on | off}: Show scroll bar, silently Think Yes   parameter pass:   1. To pass arguments to the dialog box, it is passed through arguments, the type is not limited, for the string type, the maximum is 4,096 characters, can also pass the object, for example: parent.htm     Code is as follows: <script>    var obj = new Object ();    obj.name= "justflyhigh.com";    window.showmodaldialog ("modal.htm", obj, "Dialogwidth=200px;dialogheight=100px ");   </script>     modal.htm   code is as follows: <script>  var obj = window.dialogarguments;  alert ("The parameter you passed is:" + obj.name) </script>   2. You can return information via window.returnvalue to the window that opens the dialog box, or object, for example:   parent.htm   Code as follows: <script>  var result = window.showModalDialog ("modal.htm", "dialogwidth=200px;dialogheight=100px");  alert (result); </script>   modal.htm code is as follows: <script>  window.returnvalue= "Http://www.jb51.net"; </script>    
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.