Skip to main content

Bug Tracker

Side navigation

#3591 closed enhancement (duplicate)

Opened November 10, 2008 08:35PM UTC

Closed November 11, 2009 08:36PM UTC

Patch: xhr object isn't returned in $.ajax() success callback

Reported by: alan.castro Owned by:
Priority: major Milestone: 1.4
Component: ajax Version: 1.3.2
Keywords: Cc: alan.castro
Blocked by: Blocking:

xhr object is useful to get the headers values.

Attachments (1)
  • jquery-ajax-xhr.patch (0.4 KB) - added by alan.castro November 10, 2008 08:36PM UTC.

    adds xhr object to $.ajax success callback params.

Change History (5)

Changed November 11, 2008 12:38PM UTC by flesler comment:1

cc: → alan.castro

I think you are meant to use the complete callback for that.

It does receive the xhr, they have different purposes.

Changed February 22, 2009 07:57AM UTC by robmonie comment:2

I would also really like to see this change. What i'm after is the ability to check my xhr for specific headers before proceeding with inserting the data returned into the dom. The success callback is really the only place for this that I can tell.

Using the complete() callback is no good for that as it doesn't take the data as a parameter. It's likely I can extract this from the xhr object itself however this seems potentially fragile. It would be much nicer to just have it passed into the success callback directly.

Changed July 24, 2009 02:40PM UTC by nbubna comment:3

I'd also appreciate this. Like you say, Ariel, the complete and success callbacks have different purposes, and it's in the success callback that i'd like access to the xhr. :)

Changed September 09, 2009 04:09PM UTC by robustsolution comment:4

I also ask why?

the error callback contains the XHR object in its signature while the success callback doesn't have it!.

Changed November 11, 2009 08:36PM UTC by john comment:5

milestone: 1.31.4
resolution: → duplicate
status: newclosed

Duplicate of #3363, which has been fixed.