ajax使用案例

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("抽奖遇到问题, 请刷新本页");
},
});

posted @ 2017-04-01 12:49  思风雨  阅读(140)  评论(0编辑  收藏  举报