最近在项目中用到了
showModalDialog,在测试中,IE,Firefox中正常运行,但是在google中,点击后没什么反应,在网上看了一下,谷歌浏览器不支持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;
问题解决^_^
本文介绍了一个在谷歌浏览器中替代showModalDialog的方法,通过使用window.open实现模态对话框,并利用window.opener操作父页面元素,解决了谷歌浏览器不支持showModalDialog的问题。
3065

被折叠的 条评论
为什么被折叠?



