title: Event undefined issue in onbeforeunload function
body: <p>I am using following code. But I am getting result as event is undefined. What could be the possible reasons for this?</p>
  
  <pre><code>window.onbeforeunload = function(event){
        if(window.event.clientX &lt; 0 &amp;&amp; window.event.clientY &lt;0){
            alert('Browser close button clicked'); 
        }
  } 
  </code></pre>