title: Reload the page when I switch to another tab and come back
body: <p>I have used the below Javascript code.   </p>
  
  <pre><code>$(window).focus(function () {
      window.location.reload(true);
  });
  </code></pre>
  
  <p>Which was called in <code>focus</code> event. But whenever I switch or click on some other application or desktop tab, it's started reloading. I need it to be reloaded only when I switch over tabs not when I clicked somewhere other than a browser.</p>