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

Yasmin ·
更新时间:2024-09-20
· 795 次阅读

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

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

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

代码如下:
window.open("xsp/exesp?todo=13","","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;



浏览器 方法 谷歌 谷歌浏览器

需要 登录 后方可回复, 如果你还没有账号请 注册新账号