异步轮询函数

/**
 * 异步轮询函数
 */
function get_msg (url) {
	$.getJSON(url, function (data) {
		if (data.status) {
		   news({
				"total" : data.total,
				"type" : data.type
			});
		}
		setTimeout(function () {
			get_msg(url);
		}, 5000);
	});
}

  

原文地址:https://www.cnblogs.com/ahwu/p/3269172.html