Skip to main content

Bug Tracker

Side navigation

#8000 closed enhancement (wontfix)

Opened January 18, 2011 07:58PM UTC

Closed April 16, 2011 08:58PM UTC

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

Attachments (0)
Change History (7)

Changed January 18, 2011 08:24PM UTC by rwaldron comment:1

owner: → john.firebaugh
status: newpending

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!

Changed January 18, 2011 08:24PM UTC by rwaldron comment:2

component: unfiledajax

Changed January 18, 2011 09:41PM UTC by danheberden comment:3

Congratulations! You've placed the 8000th bug ticket!

Changed January 20, 2011 02:08AM UTC by tianon comment:4

The following diff implements the (backwards compatible!) fix found in one of the posts on the forum (created from latest "jQuery 0 GIT" code):

diff --git speed/jquery-basis.js speed/jquery-basis.js
index fff6776..8316277 100644
--- speed/jquery-basis.js
+++ speed/jquery-basis.js
@@ -5306,7 +5306,7 @@ jQuery.extend({
 
 		// Fire the global callback
 		if ( s.global ) {
-			(s.context ? jQuery(s.context) : jQuery.event).trigger( "ajaxError", [xhr, s, e] );
+			(s.context ? jQuery(s.context) : jQuery.event).trigger( "ajaxError", [xhr, s, e, status] );
 		}
 	},
 

(I would attach a .patch, but Trac says no. :P)

Changed January 29, 2011 12:34PM UTC by jitter comment:5

keywords: → needsreview
priority: undecidedlow
status: pendingopen
type: bugenhancement
version: 1.4.41.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

Changed February 02, 2011 12:20PM UTC by jitter comment:6

version: 1.5rc11.5

Changed April 16, 2011 08:58PM UTC by john comment:7

resolution: → wontfix
status: openclosed

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.