var myrefresh=function(){
// 獲取選擇的賽事ID
var arr=[]; // 定義數組存儲結束信息內容
var arr1=[]; // 定義數組存儲未開始的數據
var competitionId=(‘#id option:selected’).val(); (“#content tbody tr”).each(function(){
var bgc=(this).attr(“style”);
if(bgc==”background: #BBFF66;” || bgc==”background: rgb(187, 255, 102) none repeat scroll 0% 0%;”){
arr.push($(this).attr(“id”));
}
if(bgc==undefined){
arr1.push($(this).attr(“id”));
}
})
// 異步刷新數據 .ajax({
url:’{ctx}/summary/showDataJson.shtml?strList=’+arr+’&strList1=’+arr1,
dataType : ‘JSON’,
type:’POST’,
data :{‘competitionId’:competitionId},
success : function(result){
if(result.flg==true){ // 說明後臺查詢到數據
jQuery.each(result.idList, function(i,item){ (“#content tbody tr”).each(function(){
var trId=(this).attr(“id”);
if(trId==item){ (“#”+trId).css(‘background’,’#FFCC22’);
}
})
});
jQuery.each(result.idList1, function(j,item1){
(“#content tbody tr”).each(function(){
var trId= (this).attr(“id”);
if(trId==item1){
(“#”+trId).css(‘background’,’#BBFF66’);
}
})
});
}
else{
jQuery.each(result.idList1, function(j,item1){ (“#content tbody tr”).each(function(){
var trId=(this).attr(“id”);
if(trId==item1){ (“#”+trId).css(‘background’,’#BBFF66’);
}
})
});
}
}
});
}
setInterval(‘myrefresh()’,15000); // 設置15秒刷新ajax 方法