Ajax实现定时刷新
js定时刷新
function getClientsStatus() {
var refresh_client = function() {
$.ajax({
type: "POST",
url: "../get_clients_status/",
data: {
"csrfmiddlewaretoken": csrfToken,
"utils_id": $("#utils").val()
},
success: function (data) {
$("#service_status").text(data.status);
},
});
};
refresh_client();
setInterval(refresh_client, 60000); 60秒定时刷新一次
}
getClientsStatus();