中止以前运行的Ajax请求
这个问题在这里已经有了答案:
尝试这样的事情
$(document).ready(function(){
var xhr; // global object
function your_function() {
if(xhr && xhr.readystate != 4){
xhr.abort();
}
xhr = $.ajax({
type: "POST",
url: "some.php",
data: "name=John&location=Boston",
success: function(msg){
alert( "Data Saved: " + msg );
}
});
}
});
链接地址: http://www.djcxy.com/p/71931.html