定时器:
Timer timer = new Timer();
timer.schedule(new TimerTask() {
public void run() {
// 逻辑代码
}
}, 3600000);//一小时
实时查询:
$(document).ready(function() {
hello();
});
function hello(){
$.ajax({
url:"http://xxx.com/a/xx",
type:"post",
data:{sjl:1},
dataType:"json",
success:function(data){
var str = "";
for(var i = 0; i < data.length; i++){
str += "<div class=\"box-body\">";
str += "<ul class=\"products-list product-list-in-box\">";
str += "<li class=\"item\">";
str += "<div class=\"product-info\">";
str += "<a href=\"javascript:void(0)\" class=\"product-title\"></a>";
str += "<span class=\"product-description\">"+data[i]+"</span>";
str += "</div>" + "</li>" + "</ul>" + "</div>";
}
$("#cid").html(str);
},
})
}