views:

20

answers:

1

Hey!

Is there any way that, if you have 2 or more open tabs of the same page, when you focus a tab, all other tabs will be instantly notified with "focus()"?

I give as example the Facebook Chat. If you receive a new message, all tabs keep blinking "New message from {name}!". And, if you focus a tab, all other tabs are instantly synchronized. I checked Firebug, and Facebook doesn't send any ajax request to synchronize the other tabs.

Let me know if you have any idea,
Thank you!
Nuno

+1  A: 

This is done via the server, using comet. The focused tab sends a message to the server, the all the tabs hear the event comming back via the long poll.

Tom
Yeah I know Facebook works like that for almost everything, but when I was testing this, Facebook was not sending any request, as I say in my question. Anyway, I was just testing again, and it is not currently using any Comet now, and my friends say I am offline (I assume it is currently messed for me), so probably you are right, this is done via Comet. Thank you!
Nuno Peralta