title: What is the best way to determine your web page has been made active (including switching browser tabs)?
body: <p>I have a web page which is fetching new content (AJAX).</p>
  
  <p>If the page does not have the focus (eg. Minimized, or you are on another browser tab) I want to change the title of the page to display how many new comments have appeared.</p>
  
  <p>When the user gives focus back to the page I want the title to remove the message.</p>
  
  <p>The activation of the page seems to vary wildly between browsers. Firefox seems to be the simplest to implement. I had hoped there would be a simple jQuery solution but I haven't been able to find one.</p>
  
  <p>At the moment it is implemented by checking to see if the mouse is moving over the page but if you click the page is active but the mouse hasn't mouseovered over the page.</p>
  
  <p>To be clear, I don't need help changing the title of the page or with the AJAX, just determining if the page is active or not across all browsers.</p>
  
  <p>Thanks in advance!</p>