【发布时间】:2012-06-08 08:18:04
【问题描述】:
我需要一个带有 setTimeout 的 ShowModalDialog 的功能,所以我测试一下弹出窗口 和谷歌浏览器中的 ModalDialog 我遇到了一些问题。 页面加载上有两个弹出窗口。一个由 winodw.open() 打开, 另一个由 window.showmodaldialog() 像这样打开:
setTimeout(function(){window.open("PopupWindow.html","_blank","")},100);
setTimeout(function(){window.showModalDialog("ModalDialog.html","","")},100)};
打开两个弹出窗口后,我单击 PupupWindow.html 上的一个按钮。它会调用 函数如下:
function test()
{
setTimeout(function(){alert("test");},1000);
}
在 Google Chrome 14 中运行良好。在我将 Google Chrome 更新到版本 19 后, PopupWindow.html 将在调用 test() 时挂起,直到 ModalDialog.html 关闭。 请告诉我为什么这个案例在 Google Chrome 19 或任何方式上都被破坏了 showModalDialog 和 Google Chrome 19 上的 window.open()。感谢您的帮助。
【问题讨论】:
标签: javascript google-chrome settimeout window.open showmodaldialog