Basic introduction:
showmodalDialog () (IE 4+ support)
showmodelessDialog () (IE 5+ support)
Window.showModalDialog () method is used to create a modular dialog box that displays the HTML content.
Window.showmodelessDialog () method is used to create an non -modal dialog box that displays HTML content.
How to use:
vreturnValue = Window.showmodalDialog (Surl [, Varguments] [, Sfeatures]))
vreturnValue = Window.showmodelessDialog (Surl [, VARGUMENTS] [, Sfeatures])))
Parameter description:
Surl -must -choose parameters, type: string. URL used to specify the document to be displayed in the dialog box.
varguments -optional parameter, type: variant. Used to pass parameters to the dialog box. The parameter type passed by is not limited, including array, etc. The dialog box obtains parameters passed in through Window.Dialogarguments.
sfeatures -optional parameter, type: string. Used to describe the appearance and other information of the dialog box, you can use one or more below, and use the segment ";" to separate.
------------------
1. Dialogheight: Dialogue height, not less than 100px
2. Dialogwidth: The width of the dialog box.
3. Dialogleft: distance from the left of the screen.
4. Dialogtop: distance from the screen.
5. Center: {yes | no | 1 | 0}: Whether or not in the middle, the default yes, but the height and width can still be specified.
6. help: {yes | no | 1 | 0}: Whether to display the help button, default yes.
7. Resizable: {yes | no | 1 | 0} [IE5+]: Whether it can be changed. The default NO.
8. Status: {yes | no | 1 | 0} [IE5+]: Whether to display the status bar. The default is yes [modeless] or no [modal].
9. Scroll: {yes | no | 1 | 0 | 0 | OFF}: Whether the scroll bar is displayed. The default is yes.
The following attributes are used in HTA and are generally not used in general web pages.
10. DialogHide: {yes | no | 1 | 0 | 0 | OFF}: Whether the dialog box is hidden during printing or printing preview. The default is NO.
11. EDGE: {Sunken | Raised}: Indicate the border style of the dialog box. The default is raise.
12. Unadorn: {yes | no | 1 | 0 | 0 | OFF}: The default is NO.
Parameter transmission:
1. If you want to pass the parameters in the dialog box, you can pass through Varguments. The type is not limited. For the string type, the maximum is 4096 characters. You can also pass the object, such as:
Parent.htm
Copy code code as follows:
<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 parameters you pass are:" + Obj.name)
</script>
2. You can return the information to the window that opens the dialog box through Window.ReturnValue. Of course, it can also be an object. For example:
Parent.htm
Copy code code as follows:
<script>
Str = Window.showmodalDialog ("MODAL.HTM", "Dialogwidth = 200px; Dialogheight = 100px");
alert (str);
</script>
modal.htm
<script>
window.returnValue = "// www.vevb.com";
</script>