改为onunload
好像在关闭窗体的时候不能做出提示了

解决方案 »

  1.   

    在页面reload的时候就要触发onbeforeunload事件,msdn里面关于onbeforeunload有这样一段When a string is assigned to the returnValue property of window.event, a dialog box appears that gives users the option to stay on the current page and retain the string that was assigned to it. The default statement that appears in the dialog box, "Are you sure you want to navigate away from this page? ... Press OK to continue, or Cancel to stay on the current page.", cannot be removed or altered.最后一句的意思可能是讲该dialog box不可移除或改变,这是我的理解,仅供参考
    如果楼主找到实现的办法,请告知
      

  2.   

    onunload事件好像也不行呀,看来没有办法了吗?
      

  3.   

    为什么不直接close();这样对话框的问题只要你的窗口不是OPEN出来的就解决了啊
      

  4.   

    加一个-----window.closed的调教作为时候关闭页面的条件,看看是不是好用?
      

  5.   

    忘记说了:应该现在<body>里边写个onload事件----onload="fncLoad();",然后这样写一个javascript函数:
    function fncLoad()
    {
    if (window.closed==false)

    alert("456");
    }
    }
    你看看这样做是不是你想要的结果?