[wp-trac] [WordPress Trac] #32628: Allow wp.ajax.send() requests to be stopped via abort()

WordPress Trac noreply at wordpress.org
Fri Jun 12 23:08:24 UTC 2015

#32628: Allow wp.ajax.send() requests to be stopped via abort()
 Reporter:  westonruter     |      Owner:
     Type:  task (blessed)  |     Status:  new
 Priority:  normal          |  Milestone:  4.3
Component:  General         |    Version:  3.6
 Severity:  normal          |   Keywords:  has-patch
  Focuses:  javascript      |
 For Menu Customizer (#32576) we have a search box that triggers after a
 delay triggers an Ajax request via `wp.ajax.post()`. The `promise` that
 this returns has `done()`, `fail()`, and `always()` handlers added to it.
 We want the `done()` to not happen if the user starts typing again and
 another Ajax request is initiated. In jQuery's Ajax API, the jqXHR has an
 `abort()` method which stops the HTTP request and causes the `fail()` to
 execute. However, in the `wp.ajax.send()` (and `wp.ajax.post()`) wrappers
 around jqXHR, this `abort()` method is not made available, and so there is
 no way to stop a WP Ajax request presently. I propose we add the `abort()`
 method. This was given the thumbs up:

Ticket URL: <https://core.trac.wordpress.org/ticket/32628>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list