Reputation: 6877
How does Facebook's Chat Window Remains open and in the same place When you navigate through pages
Please before you answer:
1-I'm aware of Ajax very well and the current implementation in Facebook is not normal Ajax like it used to be in the past.
2-The URL of the page changes completely not the Hash part, and the whole page reloads but not the Chat window or panel.
I Found that the URL changes through this JS Part:
history.pushState({},"New Title Goes Here","http://facebook.com/Something");
But what about the data itself how doesn't it come ? the Network->XHR in Firebug or Chrome displays nothing in the XHR. so I guess it's not Ajax.
Upvotes: 7
Views: 1687
Reputation: 3101
Looks like plenty of ajax to me.
They're selective in when they reload the chat window. Ie: if you go to account settings, and other less-traveled pages.
For the chat window loading itself, I'm fairly certain they use long-polling (comet).
Upvotes: 1