这些都没有中止 - 它仍然将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();