chrome浏览器无法得到window.showModalDialog返回值解决方法
chrome浏览器functionobject
父页面:function openwindows(){
var obj = new Object();
//obj.ordernumlst=new Array("001","002","003");
var retval = window.showModalDialog("ordervideo.jsp?orderIds="+"0010,0020,0030",obj,"dialogWidth=500px;dialogHeight=500px");
//for chrome
if(retval == undefined) {
retval = window.returnValue;
}
alert(retval);
}子页面:
function onload(){
var flag = '<%=request.getAttribute("resultflag")%>';
if(flag == 'error') {
//for chrome
if(window.opener != undefined) {
window.opener.returnValue = flag;
} else {
window.returnValue=flag;
}
window.close();
}
else if (flag == 'save') {
//for chrome
if(window.opener != undefined) {
window.opener.returnValue = flag;
} else {
window.returnValue=flag;
}
window.close();
}
}