4
如何中止jQuery 3.0中的AJAX请求?如何中止jQuery 3.0 AJAX请求?
this.r = $.ajax();
许诺不具有像abort方法中老年的jQuery版本
if(this.r && this.r.state() == 'pending')
{
this.r.abort(); <- error not working
}
如何中止jQuery 3.0中的AJAX请求?如何中止jQuery 3.0 AJAX请求?
this.r = $.ajax();
许诺不具有像abort方法中老年的jQuery版本
if(this.r && this.r.state() == 'pending')
{
this.r.abort(); <- error not working
}
在jQuery中3.0,jQuery.Deferred是承诺/ A +兼容。 The cancellation spec仍在开发中,所以目前无法中止AJAX请求。
另请参阅Status of cancellable promises了解有关规格的一些背景信息。
让我们试试这个解决方案http://stackoverflow.com/questions/4551175/how-to-cancel-abort-jquery-ajax-request – Mardzis
这并不适用于jquery 3.0。我试过了!获取放弃方法未定义 – pokahotass