title: how to stop setInterval auto-refresh when page/tab is inactive?
body: <p>i have a javascript to parse twitter feeds and show them in a block in my page every 30 seconds, the code is something like this:</p>
  
  <pre>
  var auto_refresh = setInterval(
  function ()
      {
          //get twitter feeds
      });
  }, 30000);
  </pre>
  
  <p>now in case the user minimized his browser or switched to another tab (page is not active) i want to disable this auto_referesh <code>clearInterval(auto_refresh);</code></p>
  
  <p>Thanks for your help</p>