jQuery / AJAX - Abort没有中止

时间:2014-10-23 12:21:41

标签: jquery ajax

这些都没有中止 - 它仍然将compareusername.php的POST结果放入#userRegexJavascriptResponse。如何使中止正常工作?

var xhr = $.ajax({
type: "POST",
url: "compareusername.php",
data: {"userCreation": $('#userCreation').val()},
success: function(msg){
    $("#userRegexJavascriptResponse").text(msg);
}
});
xhr(); 
xhr.abort();

var xhr = $.post("compareusername.php", { userCreation:$('#userCreation').val() 
}, function(data){
$("#userRegexJavascriptResponse").text(data);
});
xhr();
xhr.abort();

0 个答案:

没有答案