//5秒刷新一次
$(function () {
setInterval(Refresh, 5000);
});
//ajax局部刷新
function Refresh() {
$.ajax({
type: "POST",
url: "/User/GetInfo",
dataType: "json",
data: {},
success: function (data) {
$("#mytable tr:gt(0)").remove();
var info = "";
$.each(data, function (i, v) {
info += "<tr>";
info += "<td>" + v.Name+ "</td>";
info += "<td>" + v.BAK + "</td>";
info += "<td>" + ChangeDateFormat(v.CreateTime) + "</td>";//json日期格式转换
info += "</tr>";
});
$("#mytable").append($(info));
},
async: true
});
}