How to Use showmodaldialog in Javascript

Source: Internet
Author: User

Functions of the showmodaldialog function:
Open a Child Window and pass data with the parent window. The biggest difference between it and window. Open is that after showmodaldialog opens the child window, the parent window cannot be operated.
Usage:
Vreturnvalue = Window. showmodaldialog (Surl [, varguments] [, sfeatures])
Parameter description:
Surl
Required parameter. Type: string. Specifies the URL of the document to be displayed in the dialog box.
Varguments
Optional parameter; Type: variant. Used to pass parameters to the dialog box. The passed parameter types are not limited, including arrays. The dialog box uses window. dialogarguments to obtain the passed parameters.
Sfeatures
Optional parameter; Type: String. Used to describe the appearance and other information of the dialog box. You can use one or more of the following, separated by semicolons.
In the dialogheight dialog box, the height is not smaller than PX. In ie4, the default unit of dialogheight and dialogwidth is em, while in ie5, the default unit is PX. For convenience, When you define the modal mode dialog box, unit with PX.
Dialogwidth: Dialog Box width.
Dialogleft: The left distance from the desktop.
Dialogtop: the distance from the desktop.
Center: {Yes | no | 1 | 0}: whether the window is centered. The default value is yes, but the height and width can still be specified.
Help: {Yes | no | 1 | 0}: whether to display the Help button. The default value is yes.
Resizable: {Yes | no | 1 | 0} [ie5 +]: whether the size can be changed. No by default.
Status: {Yes | no | 1 | 0} [ie5 +]: whether to display the status bar. The default value is Yes [modeless] or no [modal].
Scroll: {Yes | no | 1 | 0 | on | off}: Specifies whether the scroll bar is displayed in the dialog box. The default value is yes.
Parameter transfer method:
The parent window can pass parameters to the Child Window using the 2nd showmodaldialog parameters. To obtain parameters returned by the Child window, the parent window can be obtained through the return value of the showmodaldialog function.
The method for obtaining the parameters of the parent window in the subwindow is to use the dialogarguments attribute of the window object in the subwindow. For example:
VaR A = Window. dialogarguments;
The window. returnvalue attribute is used in the Child Window to return parameters to the parent window, for example:
Window. returnvalue = 1;
Window. Close ();

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.