同上

解决方案 »

  1.   

    <HTML>
    <HEAD>
    <title>test</title>
    <script language="javascript">
    function a() {
    window.event.returnValue = '不允许关闭当前window,请点击cancel.';
    }</script>
    </HEAD>
    <body onbeforeunload="a()" ></body>
    </HTML>
      

  2.   

    <script>
    function window.onbeforeunload()
    {
    if(event.clientX>document.body.clientWidth&&event.clientY<0||event.altKey)
    {
    window.event.returnValue="Close?";
    }
    }
    </script>
      

  3.   

    可以show一个无边框的模态窗口,模态窗口不关闭,父窗口是无法响应事件的
      

  4.   

    <html>
    <head>    
    <title></title>
    </head>
    <body onbeforeunload="window.event.returnValue='要关闭吗?'">
    </body>
    </html>