解决Chrome浏览器中使用showModalDialog返回值为undefined
在线解决解决Chrome浏览器中使用showModalDialog返回值为undefined 的方法和源代码
父层主页面:
<script type="text/javascript">
function SelectGroupCust() {
var temp = window.showModalDialog("Default2.aspx?xx=" + Date(), "", "dialogWidth=800px;dialogHeight=600px;help=no;center=yes;");
//for chrome
if (temp == undefined) {
temp = window.returnValue;
}
alert(temp);
return true;
}
</script>
弹出子页面代码:
<script language="javascript" type="text/javascript">
function ReturnAddressee() {
if (window.opener != undefined) {
window.opener.returnValue = "1";
}
else {
window.returnValue = "2";
}
window.close();
}
</script>