title: How to detect browser close event in MS Edge?
body: <p>We are using <code>jQuery v1.11.3</code></p>
  <p>The requirement is to display a Confirmation dialog with Yes and No button. The Confirmation dialog needs to be displayed before closing the browser and when user click on close icon.</p>
  <p>Below code tried to use but not working .</p>
  <pre><code>&lt;script type=&quot;text/javascript&quot;&gt;
  $(document).ready(function(){
      $(window).bind(&quot;beforeunload&quot;, function() { 
          return &quot;Do you really want to close?&quot;; 
      });
  }); 
  
  
  window.onbeforeunload = function(e){  
    return 'Calling some alert messages here'; 
  }
  
  &lt;/script&gt;
  </code></pre>