如何在 jQuery 3.0 中中止 AJAX 请求?
this.r = $.ajax();
promise 没有像旧 jQuery 版本中那样的中止方法
if(this.r && this.r.state() == 'pending')
{
this.r.abort(); <- error not working
}
最佳答案
在 jQuery 3.0 中,jQuery.Deferred 与 Promises/A+ 兼容。 The cancellation spec仍在开发中,因此目前无法中止 AJAX 请求。
另见 Status of cancellable promises有关规范的一些背景信息。
关于javascript - 如何中止 jQuery 3.0 AJAX 请求?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40421186/