Window is used in the project. showModalDialog (url) opens the modal dialog box. After the operation is complete, close the dialog box and refresh the parent page. In the subwindow, use window. dialogArguments. location. reload (true); prompt "window. dialogArguments. location is null or not an object ".
Google found that some parameters of the showModalDialog method are as follows:
Usage:
VReturnValue = window. showModalDialog (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.
In the dialogHeight dialog box, the height is not smaller than px. In IE4, the default unit of dialogHeight and dialogWidth is em, while in IE5, the default unit is px. For convenience, When you define the modal mode dialog box, unit with px.
DialogWidth: Dialog Box width.
DialogLeft: The left distance from the desktop.
DialogTop: the distance from the desktop.
Center: {yes | no | 1 | 0}: whether the window is centered. The default value is yes, but the height and width can still be specified.
Help: {yes | no | 1 | 0}: whether to display the help button. The default value is yes.
Resizable: {yes | no | 1 | 0} [IE5 +]: whether the size can be changed. No by default.
Status: {yes | no | 1 | 0} [IE5 +]: whether to display the status bar. The default value is yes [Modeless] or no [Modal].
Scroll: {yes | no | 1 | 0 | on | off}: Specifies whether the scroll bar is displayed in the dialog box. The default value is yes.
Sadly, window. showModalDialog (url, window) does not report an error, but continues to be invalid ......
Google found the working mechanism of the modal web page dialog box. After the original parent window is called, it will stay in the window. showModalDialog (url, window); on this statement, that is, when the parent page opens the modal dialog box, js stays on it, and the code behind it is not executed. You can use the following method to refresh the parent page:
Window. showModalDialog (url, window );
Location. reload ();
At the same time, you can accept the return value var result = window. showModalDialog (url, window );
var result=window.showModalDialog('"+url+"','window','dialogHeight:400px;dialogWidth:800px;help:no;status:no');document.getElementById(\"hide_IfSet\").value=result;location.reload();