Modal and Modeless Dialog Boxes: The Command Syntax - Doc JavaScript
Modal and Modeless Dialog Boxes
The Command Syntax
The syntax of showModalDialog()
is as follows:
vReturnValue = window.showModalDialog(sURL [, vFreeArgument] [, sOrnaments]);
The syntax of showModelessDialog()
is identical:
vReturnValue = window.showModelessDialog(sURL [, vFreeArgument] [, sOrnaments]);
In the following pages, we'll explain in detail each of these parameters. Here is a brief summary:
vReturnValue
. The functionshowModalDialog()
returns the value of thereturnValue
property as set by the opened dialog window. The functionshowModelessDialog()
returns the new window object.vFreeArgument
. You can use this optional parameter to pass a value of any type to the open dialog box. You can pass a scalar, a string, an array of values, an object, etc. You access this value in the new window by referring to thedialogArguments
property of the newwindow
object. You can access thedialogArguments
property of the newwindow
object, only when you callshowModalDialog()
orshowModelessDialog()
from a "trusted" application.sOrnaments
. You can use this optional parameter to specify the look of the new window. There are a dozen ornaments you can control. You need to concatenate the window's properties you want to alter in one string, separating them with semicolons. The window's dozen attributes are:dialogHeight:
sHeight
dialogLeft:
sXpos
dialogTop:
sYpos
dialogWidth:
sWidth
center:
(yes
|no
|1
|0
|on
|off
)dialogHide:
(yes
|no
|1
|0
|on
|off
)edge:
(sunken
|raised
)help:
(yes
|no
|1
|0
|on
|off
)resizable:
(yes
|no
|1
|0
|on
|off
)scroll:
(yes
|no
|1
|0
|on
|off
)status:
(yes
|no
|1
|0
|on
|off
)unadorned:
(yes
|no
|1
|0
|on
|off
)
Next: How to impact the dialog box's size and location
Produced by Yehuda Shiran and Tomer Shiran
All Rights Reserved. Legal Notices.
Created: August 13, 2001
Revised: August 13, 2001
URL: https://www.webreference.com/js/column90/3.html