Ticket #3591 (closed enhancement: duplicate)
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 | |
| Blocking: | Blocked by: |
Description
xhr object is useful to get the headers values.
Attachments
Change History
Changed 5 years ago by alan.castro
-
attachment
jquery-ajax-xhr.patch
added
comment:1 Changed 5 years ago by flesler
- Cc alan.castro added
I think you are meant to use the complete callback for that. It does receive the xhr, they have different purposes.
comment:2 Changed 4 years ago by robmonie
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.
comment:3 Changed 4 years ago by nbubna
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. :)
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

adds xhr object to $.ajax success callback params.