Ticket #11745 (closed bug: invalid)
resolve, reject and notify are missing in jqXHR-object
| Reported by: | albin@… | Owned by: | |
|---|---|---|---|
| Priority: | undecided | Milestone: | None |
| Component: | unfiled | Version: | 1.7.2 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
The resolve, reject, notify with their additional With methods are missing from the jqHRX-object returned by an ajax-call. This should either be mentioned in the documentation or added to the object.
Change History
comment:1 Changed 12 months ago by gibson042
- Status changed from new to closed
- Resolution set to invalid
comment:2 Changed 12 months ago by dmethvin
Right. The docs for $.ajax are massive, but the pony *is* in there:
The jqXHR objects returned by $.ajax() as of jQuery 1.5 implement the Promise interface, giving them all the properties, methods, and behavior of a Promise (see Deferred object for more information). -- http://api.jquery.com/jQuery.ajax/#jqXHR
Promise: This object provides a subset of the methods of the Deferred object (then, done, fail, always, pipe. isResolved, and isRejected) to prevent users from changing the state of the Deferred. -- http://api.jquery.com/Types/#jqXHR
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Each jqXHR implements Promise, but not Deferred. You don't get to manually resolve/reject/notify them.