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

Share this post


Link to post
Share on other sites

I think it uses AJAX to call the new feeds on the onmouseover() event. I suspect it also has some kind of timer on inactivity otherwise it would be being called all the time.

  • Upvote 1

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

ooh my friend tells me about the compatibility of jquery in ie browser and i dont know that you can do that using javascript. i should probably consider larry's modern javascript book. thanks hartleysan

Share this post


Link to post
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.

Guest
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.

Loading...
Sign in to follow this  

×
×
  • Create New...