I have a web page which is fetching new content (AJAX).
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.
When the user gives focus back to the page I want the title to remove the message.
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.
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.
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.
Thanks in advance!