Jump to content
Larry Ullman's Book Forums

Recommended Posts



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 ?



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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...