我想停止 jquery 中的 ajax 调用,该调用不起作用
var xhr = null;
xhr = $.ajax({
url : 'www.example.com?some-large-call',
success : function(responseText) {
// some DOM manipulation
}
});
$("#button").click(function() { xhr.abort() });
Run Code Online (Sandbox Code Playgroud)
我参考了下面的链接
http://www.stoimen.com/blog/2009/09/29/jquery-stop-an-ajax-call/