如果您查看 Foursquares 网页:https://foursquare.com/
他们无需刷新页面即可自动接收新的提要。我正在构建一个后端,我们可以在其中查看特定于用户的提要。我怎样才能获得与 Foursquare 使用的相同的效果?
最佳答案
它是 setInterval
及其 ajax 调用的混合体。
setInterval(1000, function() {
// Make ajax call here to get more information and append new elements to the DOM.
});
关于javascript - 如何在不刷新页面的情况下获取页面上的新内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7111856/