开发者

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

开发者 https://www.devze.com 2023-03-29 06:04 出处:网络
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 f

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

精彩评论

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