window.onbeforeunload = function()
    {    
         var n=0;
         alert('s');
         n = window.event.screenX - window.screenLeft;  
         alert('d');
         var b = n > document.documentElement.scrollWidth-20;    
         if(b && window.event.clientY < 0 || window.event.altKey)   
         {   
               alert("是关闭而非刷新");   
         }  
     
     }这段代码在IE下没有问题  在火狐下无校 主要是  n = window.event.screenX - window.screenLeft;   这个不执行  
怎么修改 才能让火狐和IE都兼容呢?谢谢!