2016-11-04 84 views
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 
} 
+1

让我们试试这个解决方案http://stackoverflow.com/questions/4551175/how-to-cancel-abort-jquery-ajax-request – Mardzis

+0

这并不适用于jquery 3.0。我试过了!获取放弃方法未定义 – pokahotass

回答