0

在确认框中单击取消会关闭我的父窗口。我希望取消它应该留在同一页面上。我为此编写了以下代码。

function closeEditorWarning(){
    var r=confirm("This will close all the opened windows of application.Do you want to continue.");
    if (r==true)
    {   
         for (var i=0;i<childWindow.length;i++) {
                if (childWindow[i] && !childWindow[i].closed)
                    childWindow[i].close();
              }
         self.close();
         }
   else
      {
      }
}
window.onbeforeunload = closeEditorWarning;
4

1 回答 1

0

你试过删除self.close();吗?

编辑:试试这个...

window.onbeforeunload = function() {
    closeEditorWarning();
    return null;
}
于 2012-11-21T09:45:31.743 回答