开发者

How to get new content on the page, without a page refresh

If you look at Foursquares webpage : https://foursquare.com/

They have the new feeds automatically coming in without refreshing the page. I am building a backend where we can look at user speciefic feeds. How can i do get the same effect that Foursq开发者_如何学Gouare is using?


It's a mix of setInterval and their ajax call.

setInterval(1000, function() {
    // Make ajax call here to get more information and append new elements to the DOM.
});


Here is a pretty good introduction to AJAX:

http://www.w3schools.com/ajax/default.asp

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜