How to abort jquery 3.0 ajax request?

How to abort an AJAX request in jQuery 3.0?

this.r = $.ajax();

There is no interrupt method in the promise, for example, in older versions of jQuery

if(this.r && this.r.state() == 'pending')
{
  this.r.abort(); <- error not working
}
+4
source share
1 answer

In jQuery 3.0, jQuery.Deferred supports Promises / A +. A revocation specification is still under development, so it is currently not possible to abort an AJAX request.

Also see cancellation status promises for some reference specification information.

+1
source

Source: https://habr.com/ru/post/1659812/


All Articles