title: Detect Close windows event by jQuery
body: <p>Could you please give me the best way to detect <strong>only window close event</strong> for <strong>all browsers</strong> by jQuery?</p>
  
  <p>I mean clicking <kbd>X</kbd> button on the browser or <code>window.close()</code>, not meaning <kbd>F5</kbd>, form submission,
  <code>window.location</code> or link.
  I was looking for many threads but have not found the right way yet.</p>