Bug Tracker

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#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:
Blocked by: Blocking:

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 (3)

comment:1 Changed 7 years ago by gibson042

Resolution: invalid
Status: newclosed

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)

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

comment:2 Changed 7 years 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

Note: See TracTickets for help on using tickets.