如何在关闭IE时 弹出确认对话框

    技术2022-05-11  98

    关闭IE时,弹出确认对话框:

     

    定位一下,到右上角     <script   language="jscript">     window.onbeforeunload   =   function   ()     {               if   (event.clientY   <   0   &&   event.clientX>document.body.scrollWidth)   {                 event.returnValue   =   'Are   you   sure   you   want   to   leave   the   page?';           }     }     </script>   

    关闭页面时弹出关闭确认,确认关闭后清空Session

    window.οnbefοreunlοad=function()     {         var   xmlhttp=new   ActiveXObject('Microsoft.XMLHTTP');         xmlhttp.open('post','log.aspx','false');         xmlhttp.send();     }         log.aspx:     page_load事件里面:     Session.Abandon(); 


    最新回复(0)