标签:dom ajax
setTimeout(get_redis_num,5000);
function get_redis_num(){
$(‘.span_redis‘).each(function(){
var message = $(this).attr(‘id‘);
var that = this;
$.get(‘ajax.php?redis_id=‘+message,{},function(data){
if(data.nums){
var nums = data.nums;
if(nums > 0){
messages= "剩余"+nums+"个车位";
}else{
messages ="车位不足";
}
}
$(that).html(messages);
},‘json‘);
});
setTimeout(get_redis_num,5000);
}
本文出自 “枷罗博客” 博客,请务必保留此出处http://jhomephper.blog.51cto.com/8558055/1703261
标签:dom ajax
原文地址:http://jhomephper.blog.51cto.com/8558055/1703261