<body onbeforeunload="return 'ok?'">

解决方案 »

  1.   

    <script language=javascript>
    function window.onbeforeunload()
    {
      if(event.clientX>document.body.clientWidth&&event.clientY<0||event.altKey)
      {
        window.event.returnValue = "";
      }
    }
    </script>onbeforeunload 事件在页面刷新时也会被触发, 加我这些判断刷新时就不会有问题了.
      

  2.   

    你们的方法是可以阻止窗口关闭.
    但是,怎样可以不弹出系统问是否要关闭的对话框,
    而只弹出我自己用confirm的对话框?
    谢谢!