Hey, I just noticed something on facebook.com, facebook was on my other tab and I looked at SO, after a while I switched to facebook.com and it seems to disappear in the new news in the wall. How did they create a script that knows when you are active again, without clicking anywhere, should it update new messages, etc.? Just like in facebook chat, if you have it on another tab / window, you will hear “blub” or Facebook: ** NEW MESSAGE FROM: name. How does it do this?
Perform a timeout check every second, I don’t think so ?, it will be a lot of traffic and server response time if 3-4-500 million users do it every day.
Can someone provide an example where to place an ajax call, if he left the focus and focus again, how to make code that starts the ajax call? Jquery
Karem source
share