$(document).ready(function(){
initDraw();
prizeList();
});
ajax同步请求:
function initDraw(){
$.ajax({
async:false,
type: "POST",
url: "/www/initLHDraw.msp",
data: "",
success: function(data){
if(data.result == '0'){
uuid = data.id;
}
}
});
}
ajax异步请求:
function prizeList(){
var succCallBack= function(data){
if(data.result == '0'){
var actCount = data.winPrizeList.length;
var jpList = ""
for(var i=0; i<actCount; i++){
var act = data.winPrizeList[i];
jpList = jpList+"<p>"+act.userCode.substring(0, 7)+"**** "+(act.lotteryTime).substring(5, 16).replace("T"," ");
for(var j=0;j<tpinfo.length;j++){
if(tpinfo[j].id == act.awardCode){
jpList = jpList+" 获得"+tpinfo[j].name+"</p>";
}
}
}
$("#jpList").html(jpList);
}
};
var errCallBack= function(data){
alert("奖品列表获取失败");
};
var data = "city=${cityId}&imei=wap";
doAjaxRequest("/www/queryWinPrizeList.msp", data,succCallBack, errCallBack);
}
initDraw();
prizeList();
});
ajax同步请求:
function initDraw(){
$.ajax({
async:false,
type: "POST",
url: "/www/initLHDraw.msp",
data: "",
success: function(data){
if(data.result == '0'){
uuid = data.id;
}
}
});
}
ajax异步请求:
function prizeList(){
var succCallBack= function(data){
if(data.result == '0'){
var actCount = data.winPrizeList.length;
var jpList = ""
for(var i=0; i<actCount; i++){
var act = data.winPrizeList[i];
jpList = jpList+"<p>"+act.userCode.substring(0, 7)+"**** "+(act.lotteryTime).substring(5, 16).replace("T"," ");
for(var j=0;j<tpinfo.length;j++){
if(tpinfo[j].id == act.awardCode){
jpList = jpList+" 获得"+tpinfo[j].name+"</p>";
}
}
}
$("#jpList").html(jpList);
}
};
var errCallBack= function(data){
alert("奖品列表获取失败");
};
var data = "city=${cityId}&imei=wap";
doAjaxRequest("/www/queryWinPrizeList.msp", data,succCallBack, errCallBack);
}