Facebook Style Alternating Page Title - With jQuery / Javascript

April 01, 2010

This afternoon i've been trying to work out how facebook detects whether or not your focused on its interface or not. Ie focused on the browser tab.
Triggering a $(window).focus(function(){}); event in jquery will in most browsers solve coming back to the browser tab if your away from it, but in respect of how it detects on success of an ajax call whether or not to change the page title based upon if you are focused on the tab or not is still a mystery to me.

Can anyone shed any light on this?

I am now beginning to think, facebook uses a sly dog in the mix in which it detects if you have a mouse move over the body of the page, and when you do initiating all required requests.

About me

Hello! I'm David Heward, how are you going? I'm a Senior Devops/Build Engineer, specialising in AWS & Cloud Automation. Based in London. Strong 10+ year background in Software development. Have a read of my blog. Have a look at some of my working projects. Contact me at @davehewy or on Linkedin.