首页 > 代码库 > ajax问题

ajax问题

1.简单模板

  success访问成功不等于返回数据成功

$.ajax({
type:"get",
data:freedata,
dataType:"jsonp",
url:url,
success:function (data) {
if (data.retcode == "00") {
var item = data.freesort;
numNow=data.luckytimes;
$rule_number.text(numNow);
var note=data.freecardname.replace(",","").replace(",","").replace(",","");
rotateFn(item,note);
} else {
awardAlert(data.result);
};

},
error:function () {
awardAlert("网络超时,请稍后尝试",{bname:"取消"});
}
})


ajax问题