Bug Tracker

Opened 10 years ago

Closed 10 years ago

Last modified 9 years ago

#14104 closed bug (notabug)

$.ajax promise cannot be piped with a failFilter only

Reported by: [email protected] Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.9.1
Keywords: Cc:
Blocked by: Blocking:

Description

request = $.ajax({url: '/'}).pipe( null, handleError )

I'd expect that the request would be the original promise returned by $.ajax, but the abort method does not exist anymore. Is this a bug or by design? Any suggestion on how to work around it in an elegant manner?

Both version are affected, 2.0.3 as well as 1.9.1

Change History (2)

comment:1 Changed 10 years ago by dmethvin

Resolution: notabug
Status: newclosed

The result of a .pipe() is a new Deferred, not the original jQXHR, so it doesn't have an .abort() method. Save the result of $.ajax() if you need to abort.

comment:2 Changed 9 years ago by [email protected]

FWIW I've made a little library to make our lives easier if you want to retain properties across piped deferreds: https://github.com/onyxrev/jquery_promiscuous_deferred

Note: See TracTickets for help on using tickets.