<SCRIPT FOR=window EVENT=close >
alert("欢迎你下次再来")
</SCRIPT>

解决方案 »

  1.   

    可以判断执行onbeforeunload事件时鼠标的位置,若在X上面就alert
      

  2.   

    window.onbeforeunload=function()
    {
    alert(event.clientX);
    alert(document.body.clientWidth);
    alert(event.clientY);
    alert(event.altKey);

    if(event.clientX > document.body.clientWidth  &&  event.clientY<0  || event.altKey)  
    {  
    //window.event.returnValue="";  页面提示  
    }  


    //alert(window.location.href);
         
    }  为什么我的老提示 document.body.clientWidth > window.event.clientX 了?
    我这个代码是放在一个父的框架里面的  。。