问题描述:

How can I make this code update every 1 minute?

$.getJSON('/stats/rest/service.php/network/status', function(result) {

$("#currentusers").text(result.users.val);

});

网友答案:
setInterval(function () {
  $.getJSON('/stats/rest/service.php/network/status', function(result) {
      $("#currentusers").text(result.users.val);
  });
}, (1000*60)*1 ); // change '1' to however many minutes
相关阅读:
Top