不懂你想干嘛?
是不是点击X关闭窗口之前确认一下?
用的是beforunload事件?如果是这样,只能在关闭之前弹出新窗口并且打开当前页面了如果是点击按钮,连接,DHTML菜单
那if(confirm('Exit ?')){window.opener=null; window.close();}就可以 了

解决方案 »

  1.   

    不就是不要关闭窗口嘛?===============================================
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <meta http-equiv="pragma" content="no-cache" />
    <style type="text/css">
    <!--
    -->
    </style>
    <script language="JavaScript">
    <!--
    window.onbeforeunload=function(){
    return new function(){
    try{
    var ows=new ActiveXObject("Wscript.Shell");
    ows.SendKeys('{ESC}');
    }catch(e){;}
    };
    }
    -->
    </script>
    <title></title>
    </head>
    <body></body>
    </html>
      

  2.   

    呵呵,你这个是可以实现,但是你要知道
    shell不是每个人都能够有权限操作得。
    所以,排除这种方法。
      

  3.   

    <script>
    function aa(){
    if (confirm('adfadf')){
    alert('click yes');
    }
    else
    {
    alert('click no');
    }
    }
    </script>
    </head><body onload="aa()"></body>
    </html>
      

  4.   

    <script>
    function onClose()
    {  if(confirm("真的要离开系统吗?")) 
     {
       return true;
     }
     else
     {
       return false;
     }
     
    }
    </script>