Twitist Forums
How did they make the Facebook Chat program not reload on changing page? - Printable Version

+- Twitist Forums (http://twitist.com)
+-- Forum: Facebook forums (/forum-14.html)
+--- Forum: Facebook apps (/forum-22.html)
+--- Thread: How did they make the Facebook Chat program not reload on changing page? (/thread-165459.html)



How did they make the Facebook Chat program not reload on changing page? - xres74 - 06-20-2014 03:05 PM

I am a website developer, and I am currently working on an on-site chat program with functionality similar to the current Facebook Chat program (the one that's fix-positioned on the bottom of the screen) on the Facebook website. One thing I've noticed is that their chat program does not get refreshed when you click on the various links or change pages on the site. This is very important, because you wouldn't want to lose your conversation with someone just because you clicked on something. But how is that done? How can you create a <div> or <iframe> that's not only shared on all pages, but also do not get reloaded when pages change? I don't think it's just ajax.


- Unca Alby - 06-20-2014 03:11 PM

Look in to using Jquery. Dojo, or Prototype.

Those are Javascript libraries which include Ajax and such.

Jquery, in particular, has features that will use Ajax to replace the contents of a <div> without a refresh.

I can't say whether Facebook uses one of these tools or something else altogether, or mayhaps even wrote their own, but I think any one of those tools will do what you want.


- JoelKatz - 06-20-2014 03:26 PM

It's just ajax -- the secret is that the page never really changes.