jQuery.ajax({
url: "<?php echo $drawLotteryAjaxUrl; ?>",
data: {
product_id: turnplate.productids[item-1],
product_name: turnplate.productnames[item-1]
},
type: "post",
dataType: "json",
success: function(result){
if(typeof result.status == "undefined" || result.status != 0){
if(typeof result.message != "undefined" ){
alert(result.message);
}else{
alert("抽奖遇到问题, 请刷新本页");
}
}
<?php // 抽奖成功, 转盘rotate结束后页面自动刷新 ?>
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
alert("抽奖遇到问题, 请刷新本页");
},
});