Q330 How can I create a modal window in Internet Explorer 4?
You are here: irt.org | FAQ | JavaScript | Window | Q330 [ previous next ]
showModalDialog (in Internet Explorer 4) creates a dialog box and displays the HTML document given by URL. The dialog box is a
special window that is modal, meaning it retains the input focus until the user closes it. It returns a number, string,
or other value equal to the value of the returnValue property as set by the document given by URL.
Syntax
variant = window.showModalDialog(URL [, arguments [, features]])
Where:
- URL
String specifying the URL of the document to load and display. While an empty string is accepted (""), it should be noted that this is useless since once a modal dialog has been opened, it cannot be accessed by the page that opened it.
- arguments
Optional. Variant specifying the arguments to use when displaying the document. This parameter can be used to pass a value of any type including an array of values. The dialog can extract the values passed by the caller from the dialogArguments property of the window object.
- features
Optional. String specifying the window ornaments for the dialog box. It can be a combination of the following values. Syntax Description
- dialogWidth:number
Sets the width of the dialog window.
- dialogHeight:number
Sets the height of the dialog window.
- dialogTop:number
Sets the top position of the dialog window relative to the upper-left corner of the desktop.
- dialogLeft:number
Sets the left position of the dialog window relative to the upper-left corner of the desktop.
- center:{yes | no | 1 | 0 }
Specifies whether to center the dialog window within the desktop. Default is yes.
For further information see
http://msdn.microsoft.com/workshop/Author/dhtml/reference/methods/showModalDialog.asp
for the showModalDialog method, and
http://developer.netscape.com:80/viewsource/goodman_modal/goodman_modal.html
for a Netscape Navigator version.
©2018 Martin Webb