jsウィンドウを閉じる時はオンベフォーンワンロードを操作します.


 

  <script type="text/javascript">   
<!--     
    window.onbeforeunload = onbeforeunload_handler;   
    window.onunload = onunload_handler;
	
    function onbeforeunload_handler(){ 
		//if          
		if (event.clientX>document.body.clientWidth && event.clientY<0 ||event.altKey){
			 var warning="    ?";  
			 alert('onbeforeunload ');
		}
        return warning;   
    }   
       
    function onunload_handler(){   
		alert('onunload' );
        var warning="    ";   
        alert(warning);   
    }   
// -->   

</script>