Jump to content
Larry Ullman's Book Forums

Recommended Posts

Hi.

 

I was just wondering how facebook does it's continious updates on the wall if you know what I mean, I take it after a certain amount of time it calls a scripts which then gets the latest round of updates.

 

So what technologies would be used here ? and also how would you stop it from repeating it's-self(i.e. calling the same data from before) ? Also does anyone know of any examples of this ?

 

Regards

Link to comment
Share on other sites

Most likely, FB is using the setInterval function in JS. The function can be used to perform a call to a function every so many milliseconds. From there, you just update the info as necessary using Ajax. I imagine that whenever data is updated/displayed, they place a timestamp in a variable, and when the setInterval function is called, it only grabs data with a more recent timestamp than the timestamp stored in the local JS variable. There are any number of approaches to this, and it really depends on how much you need to update your page, etc.

  • Upvote 1
Link to comment
Share on other sites

  • 11 months later...

jQuery is a Javascript library written entirely in Javascript, and Ajax is a technology (if you will) that involves using a specific object in Javascript to make asynchronous calls to server-side scripts.

You can use both Javascript and jQuery to make Ajax calls. I prefer the JS way, but many people claim that the jQuery way of implementing Ajax is easier.

If you wanna know more, I recommend picking up Larry's Ajax book.

Link to comment
Share on other sites

 Share

×
×
  • Create New...