onunload=function (){
 window.open('checkUnLoad.asp','wina','left=10000.top=10000.width=10.height=10');
}

解决方案 »

  1.   

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

  2.   

    to all:怎么触发unload事件从?to: eglic(圪圪)
    你的代码应该放在页面的哪里?to:好多星的牛人
    我要做一个聊天室
    我的聊天室 ,别人一点叉就无法对该用户所使用的资源释放
    你的代码很好
    不过我看163和tom的聊天室都没有弹出对话框 我也想做到那样
    具体代码该怎么写
    我知道你一定会的
      

  3.   

    <script language=javascript>
    window.onbeforeunload = function()
    {
      if(event.clientX>document.body.clientWidth&&event.clientY<0||event.altKey)
      {
        //window.event.returnValue = ""; //去掉这句就不会有关闭提示了
        //客户端的操作你自己组织;
        //关闭网页向服务器发出请求的示例:
        var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); 
        xmlhttp.open("GET", "SessionEnd.aspx", false);
        xmlhttp.send();
        xmlhttp = null;
      }
    }
    </script>
      

  4.   

    test.html是要关闭的页面,是通过链接从index.html过来的
    在test.html页面上点叉后执行一段代码,xxxxxxxxxx
    我把这段代码放到下面 可是我不知道怎么调用这个js<script language=javascript>
    window.onbeforeunload = function()
    {
      if(event.clientX>document.body.clientWidth&&event.clientY<0||event.altKey)
      {
        window.event.returnValue = "";    xxxxxxxxxxxx
        
      }
    }
    </script>谢谢