首页 > 语言 > JavaScript > 正文

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

2024-05-06 14:51:24
字体:
来源:转载
供稿:网友

忽然发现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;

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表

图片精选