当前位置:首页 >> 网络编程

谷歌浏览器不支持showModalDialog模态对话框的解决方法

忽然发现Chrome浏览器版本 37.0.2062.103 m 不支持showModalDialog模态对话框和无法返回returnValue

项目原先用到的都不能正常执行

找了个折中方案利用window.open代替showModalDialog利用 window.opener.document来操作父页面的元素

复制代码 代码如下:
window.open("xsp/exesp","","height=500,width=280,status=yes,toolbar=no,menubar=no,location=no");

复制代码 代码如下:
window.close();
window.opener.document.getElementById("classid").value=treeid;
window.opener.document.getElementById("classname").value=treename;