Recently found in Google browser a problem is that the use of Google Browser is not compatible with window.showModalDialog, so it is changed to use window.open ().
First, window.showmodaldialog example:
1. Parent page: JS
var returnvalue=window.showmodaldialog ("selectuserlist.jsp?order_id=" +order_id+ "&appid=" +appID+ "&prod_" Name= "+prod_name+" &order_state= "+order_state+" &prod_id= "+prod_id+" &app_code= "+app_code+" &app_ Fee_type= "+app_fee_type+" &admin_flag= "+admin_flag,0," dialogwidth=480px;dialogheight=510px;resizable:no; Dialogleft:550px;dialogtop:100px;status:no;scroll:no;resizable:no ");
if (returnvalue = = "OK") {//"OK" is the return value of the sub-page
$ ("#goPageButton"). Click ();
}
2. Sub-page: selectuserlist.jsp
Window.returnvalue = "OK";
Two: window.open Example:
1. Parent page:
<script language= "javascript" type= "Text/javascript" >
VAR wd;
var wintimer;//timer variable, listener window closed
function Openwindow () {
WD = window.open ("test2.html", NULL, "height=300,width=450, left=300px,top=20px, Menubar=no,titlebar=no,scrollbar=no , Toolbar=no, Status=no,location=no ");
if (WD)
Window.wd.focus ();//Determines whether the window is open, if open, window front
Wintimer=window.setinterval ("wisclosed ()", 500);
}
function wisclosed () {
if (wd.closed) {
alert (window.returnvaule);//Subform return value
Here you can do assignment operations
Window.clearinterval (Wintimer);
}
}
</script>
<body>
<input type= "button" id= "Btnshow" onclick= "Openwindow ();" Value= "Show child windows"/>
</body>
2. Sub-page:
<script language= "javascript" type= "Text/javascript" >
function Doclose () {
Window.opener.window.returnvaule= "OK";
Parent.window.close ();
}
</script>
<body>
<input type= "button" id= "Btnselect" onclick= "Doclose ();" Value= "Off"/>
</body>
window.showModalDialog return value and window.open return value instance detailed