87,901
社区成员
发帖
与我相关
我的任务
分享
var xhr=$.ajax({
type: "GET",
url:'/ajax.php?a=check_comment',
data:{ comment_id: value}
}).success(function(date){
try{
var mj=jQuery.parseJSON(date);
if(mj!==null){
$('#comment_pid').val(mj.id).next('textarea').html('').focus();
}
}catch(exception){
eval(date);
}
});
return;
xhr.complete(function(){
alert('xhr is complate');
});
在进入success之前,执行了一次return,还能进入success吗? re: 在哪执行的呀?
var xhr=$.ajax({
type: "GET",
url:'/ajax.php?a=check_comment',
data:{ comment_id: value}
});
return;
xhr.done(function( date ) {
try{
var mj=jQuery.parseJSON(date);
if(mj!==null){
$('#comment_pid').val(mj.id).next('textarea').html(''+mj.message+'
').focus();
}
}catch(exception){
eval(date);
}
});
这种是不会执行回调的ajax?你贴一下代码我瞧瞧
return后面的代码不会执行,这个要看你回调函数在什么情况下触发了