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
精彩评论