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/