//获取待审核笑话
function GetArticle() {
$(".btn_review").attr("disabled", "disabled");
$.ajax({
url: "/ajax/xx.ashx",
type: "post",
dataType: "json",
async: false,
data: { action: "Manuscript" },
beforeSend: function (data) {
$("#revcontent").html("
正在努力加载笑话……
},
success: function (data) {
if (data.status == "success") {
//已登录则加载待审核内容
jokeid = data.jokeid;
if (data.title != "") {
$("#revtitle").text(data.title);
$("#revtitle").show();
} else {
$("#revtitle").text("");
$("#revtitle").hide();
}
$("#revcontent").html(data.content);
if (data.img != "") {
$("
}
$(".btn_review").removeAttr("disabled");
} else if (data.status == "nologin") {
showmodel();
$("#revcontent").html("
你还没有登陆或者登陆超时,请重新登陆!
");$("#revtitle").text("");
$("#revtitle").hide();
} else {
$("#revcontent").html("
" + data.msg + "
");$("#revtitle").text("");
$("#revtitle").hide();
}
},
error: function (data) {
alert(data.status+";" + data.responseText);
}
});
}
//审核笑话
function revjoke(revstatus) {
if (jokeid == 0) {
GetArticle();
return false;
}
var jid = jokeid;
jokeid = 0;
$(".btn_review").attr("disabled", "disabled");
if (revstatus == 2) {
GetArticle();
} else {
$.ajax({
url: "/ajax/xx.ashx",
dataType: "json",
async: false,
type: "post",
data: { aid: jid, result: revstatus, action: "rew" },
success: function (data) {
if (data.status == "success") {
if (revstatus == 0) {
$("#alertrevfile").show();
} else if (revstatus == 1) {
$("#alertrevsuccess").show();
}
setTimeout(function () {
$(".alertrevstatus").hide();
GetArticle();
}, 1000);
} else if (data.status == "nologin") {
showmodel();
} else {
$("#revcontent").html("
" + data.msg + "
");}
}
});
}
}
以上是jQuery的Ajax请求,
我点击换一个的时候就执行GetArticle()方法,可是怎么会有时请求回调成功,有时会到error里面去呢?求大神给指点,急啊