views:

28

answers:

1

I influenced from StackOverflow Chat.
Here when the page is inactive then number of the new incoming chat messages are displayed in the Page title. When the page is activated the this number is disappeared. How can I implement this concept in my application? I also want to highlight that window.

+1  A: 

detecting when it goes inactive can be done with 'window.onblur' (the onblur event)

detecting when it goes active again can be done with 'window.onfocus' (the onfocus event)

DoXicK
And if if you want to check "idle" you can add a timer on a field to check if there was anything that was typed in the field or any other event that you find interesting to check.
Maskime