Opened 12 years ago
Closed 12 years ago
#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: | |
Blocked by: | Blocking: |
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 (7)
comment:1 Changed 12 years ago by
Owner: | set to john.firebaugh |
---|---|
Status: | new → pending |
comment:2 Changed 12 years ago by
Component: | unfiled → ajax |
---|
comment:4 Changed 12 years ago by
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 12 years ago by
Keywords: | needsreview added |
---|---|
Priority: | undecided → low |
Status: | pending → open |
Type: | bug → enhancement |
Version: | 1.4.4 → 1.5rc1 |
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
comment:6 Changed 12 years ago by
Version: | 1.5rc1 → 1.5 |
---|
comment:7 Changed 12 years ago by
Resolution: | → wontfix |
---|---|
Status: | open → closed |
As mentioned in another, similar, ticket - as soon as we can land this API change (1.7) we'll probably be removing, or significantly changing, global Ajax events.
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!