The return value of the ShowModalDialog is available under IE and Firefox, but it returns null below Google Browser, and the following are the solutions
Parent page:
Copy Code code as follows:
function OpenWindows () {
var obj = new Object ();
Open the modal subform and get the return value
var retval = window.showModalDialog ("ordervideo.jsp?rderids=" + "0010,0020,0030", obj, "dialogwidth=500px; dialogheight=500px ");
For Chrome
if (retval = = undefined) {
retval = Window.returnvalue;
}
alert (retval);
}
Sub page:
Copy Code code as follows:
function onload () {
//for chrome
if (Window.opener!= d) {//window.opener's value is not empty under Google Browser, ie/Firefox is not defined below, which determines whether Google browser
Window.opener.returnValue = flag; Google browser to the return value of the method of assigning value window.opener.close (); This must be turned off once, otherwise the following window.close () cannot close the pop-up window because the pop-up window under Google Browser is a new window
}
Else {
Window.returnvalue=flag; This method of assignment is compatible with ie/Firefox, but does not support Google browser
}
Window.close ();
}