Basic Introduction:
Showmodaldialog () (ie 4 +
Supported)
Showmodelessdialog () (ie 5 +
Supported)
Window. showmodaldialog ()
Method To create a modal dialog box that displays HTML content.
Window. showmodelessdialog ()
Method to create a non-modal dialog box that displays HTML content.
Usage:
Vreturnvalue = Window. showmodaldialog (Surl [, varguments]
[, Sfeatures])
Vreturnvalue = Window. showmodelessdialog (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.
----------------
1. dialogheight: dialog box height, not smaller than 100px
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}: whether to center. The default value is yes, but the height and width can still be specified.
6. Help:
{Yes No 1 0}: whether to display the Help button. The default value is yes.
7. resizable: {Yes No 1 0} [ie5 +]:
Whether the size can be changed. No by default.
8. Status: {Yes No 1 0} [ie5 +]: whether to display the status bar. The default value is Yes [
Modeless] or no [modal].
9. Scroll: {Yes No 1 0 on off}: whether to display the scroll bar. The default value is yes.
The following attributes are used in HTA and are not used in general web pages.
10. dialoghide: {Yes No 1 0 on off}: whether the dialog box is hidden during print or preview. The default value is no.
11.
Edge: {sunken raised}: Specifies the border style of the dialog box. The default value is raised.
12. unadorned: {Yes No 1 0 on
Off}: The default value is no.
Parameter transfer:
1. varguments is used to pass Parameters in the dialog box. The type is not limited. For string types, the maximum value is 4096 characters. Objects can also be passed, for example:
-------------------------------
Parent.htm
<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>
-------------------------------
2.
You can use window. returnvalue to return information to the window that opens the dialog box. It can also be an object. For example:
------------------------------
Parent.htm
<SCRIPT>
Str
= Window. showmodaldialog ("modal.htm", "dialogwidth = 200px; dialogheight = 100px ");
Alert (STR );
</SCRIPT>
Modal.htm
<SCRIPT>
Window. returnvalue = "http://www.webjx.com ";
</SCRIPT>