JavaScript window.showModalDialog() 无法在 Chrome 上运行

标签 javascript asp.net-mvc google-chrome

window.showModalDialog() 无法在 Chrome 版本 51.0.2704.84m 上的 ASP.Net 页面上运行。 原因是什么?

最佳答案

我找到了window.showmodaldialog not working in chrome但并没有多大帮助。但后来发现我们需要在 Chrome 中使用 window.open,因为 Chrome 中不推荐使用 window.showModalDialog 然后发现了一些有用的信息http://javascript.about.com/library/blmodal.htm有效。

function modalWin() {
if (window.showModalDialog) {
window.showModalDialog("xpopupex.htm","name",
"dialogWidth:255px;dialogHeight:250px");
} else {
window.open('xpopupex.htm','name',
'height=255,width=250,toolbar=no,directories=no,status=no,
continued from previous linemenubar=no,scrollbars=no,resizable=no,modal=yes');
}
} 

关于JavaScript window.showModalDialog() 无法在 Chrome 上运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37783198/

相关文章:

javascript - 更改哪个元素递增 JavaScript

c# - MVC 多个 DropDownLists from 1 List<SelectListItem>

asp.net-mvc - 关于高流量网站缓存的问题

html - 我丢失了我的 CSS 文件,但该页面仍在浏览器中,如何恢复?

google-chrome - "Tainted canvases may not be loaded"WebGL纹理的跨域问题

javascript - 如何在浏览器中通过 POST 请求加载外国图片?

javascript - nodeJS TLS 在数据中包含奇数字符

JavaScript «检测 <N 空槽> 未定义»

c# - 如何更改 Asp.NET MVC 中的 Controller 命名约定?

css - 粗体字体在 Mac 上看起来很奇怪