288 Part III . Document Objects Reference (Web server logs) showModalDialog( URL [,

288 Part III . Document Objects Reference showModalDialog( URL [, arguments] [, features]) showModelessDialog( URL [, arguments] [, features]) Returns: returnValue (modal) or window object (modeless). Compatibility NN2 NN3 NN4 NN6 IE3/J1 IE3/J2 IE4 ( ) IE5 . IE5.5 . IE4+ provides methods for opening a modal dialog box window, which always stays in front of the main browser window while making the main window inaccessible to the user. In IE5 (but not IE5/Mac), Microsoft added the modeless type of dialog box, which also stays in front, but allows user access to whatever can be seen in the main window. You can load any HTML page or image that you like into the dialog box window, by providing a URL as the first parameter. Optional parameters let you pass data to a dialog box and give you considerable control over the look of the window. Unfortunately, these types of dialog box windows are not available in Navigator. At best, you can simulate modal and modeless dialog box windows, but the job is not for beginners (see http://developer.netscape.com/viewsource/ goodman_modal/goodman_modal.htmlfor one example). The windows generated by both methods are (almost) full-fledged window objects with some extra properties that are useful for what these windows are intended to do. Perhaps the most important property is the window.dialogArgument property. This property lets a script read the data that is passed to the window via the second parameter of both showModalDialog() and showModelessDialog(). Passed data can be in any valid JavaScript data type, including objects and arrays. Displaying a modal dialog box has some ramifications for scripts. In particular, script execution in the main window halts at the statement that invokes the showModalDialog() method as long as the modal dialog box remains visible. Scripts are free to run in the dialog box window during this time. The instant the user closes the dialog box, execution resumes in the main window. A call to show a modeless dialog box, on the other hand, does not halt processing because scripts in the main page or dialog box window are allowed to communicate live with the other window. Retrieving dialog data To send data back to the main window s script from a modal dialog box window, a script in the dialog box window can set the window.returnValueproperty to any JavaScript value. It is this value that gets assigned to the variable receiving the returned value from the setModelDialog() method, as shown in the following example: var specifications = window.showModalDialog( preferences.html ) windowObject.showModalDialog()
If you are in need for cheap and reliable webhost to host your website, we recommend http web server services.

Leave a Reply