Ticket #8000 (closed enhancement: wontfix)
textStatus unavailable from ajaxError
| Reported by: | john.firebaugh | Owned by: | john.firebaugh |
|---|---|---|---|
| Priority: | low | Milestone: | 1.next |
| Component: | ajax | Version: | 1.5 |
| Keywords: | needsreview | Cc: | |
| Blocking: | Blocked by: |
Description
The jQuery.ajax error callback is passed XMLHttpRequest, textStatus, and errorThrown parameters.
The ajaxError callback is passed event, XMLHttpRequest, ajaxOptions, and thrownError parameters. The "textStatus" parameter should also be made passed, so that global ajaxError callbacks have access to the same state as error callbacks.
Reported on forums here: http://forum.jquery.com/topic/textstatus-unavailable-from-ajaxerror
Change History
comment:1 Changed 2 years ago by rwaldron
- Owner set to john.firebaugh
- Status changed from new to pending
comment:4 Changed 2 years ago by tianon
The following diff implements the (backwards compatible!) fix found in one of the posts on the forum (created from latest "jQuery 0 GIT" code):
-
speed/jquery-basis.js
diff --git speed/jquery-basis.js speed/jquery-basis.js index fff6776..8316277 100644
jQuery.extend({ 5306 5306 5307 5307 // Fire the global callback 5308 5308 if ( s.global ) { 5309 (s.context ? jQuery(s.context) : jQuery.event).trigger( "ajaxError", [xhr, s, e ] );5309 (s.context ? jQuery(s.context) : jQuery.event).trigger( "ajaxError", [xhr, s, e, status] ); 5310 5310 } 5311 5311 }, 5312 5312
(I would attach a .patch, but Trac says no. :P)
comment:5 Changed 2 years ago by jitter
- Keywords needsreview added
- Priority changed from undecided to low
- Version changed from 1.4.4 to 1.5rc1
- Status changed from pending to open
- Type changed from bug to enhancement
This could be a valid enhancement but needs some discussion.
The main problem I have with this is, that it would create yet another different signature (speaking of parameter order). Where the situation in that regard is already bad enough with the different ajax callbacks. But maybe it can't be made worse by adding another parameter. Marking for discussion for a future release
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Thanks for taking the time to contribute to the jQuery project! Please provide a reduced jsFiddle test case to help us assess your ticket!
Additionally, test against the jQuery 0 GIT version to ensure the issue still exists. Be Excellent to eachother!