Skip to main content

Bug Tracker

Side navigation

#4964 closed feature (fixed)

Opened July 24, 2009 04:06AM UTC

Closed January 13, 2011 04:01PM UTC

Last modified January 31, 2011 04:27PM UTC

Support ajax callbacks for specific status codes

Reported by: nbubna Owned by:
Priority: high Milestone: 1.5
Component: ajax Version: 1.3.2
Keywords: ajaxrewrite Cc:
Blocked by: Blocking:
Description

From this thread:

http://groups.google.com/group/jquery-dev/browse_thread/thread/41be75884cc2aead

It would be nice to be able to specify callbacks to handle specific status codes. Supporting this would make extending $.ajax behavior more difficult (for things like http://plugins.jquery.com/project/rest). So, along with this, it would be nice to support a 'ready' callback that would be called once the XHR is done and before any other callbacks are executed.

I've attached a patch to support both.

Attachments (2)
  • ajaxpatch.txt (1.0 KB) - added by nbubna July 24, 2009 04:07AM UTC.

    Suggested implementation

  • jquery4964.patch (1.0 KB) - added by nbubna July 29, 2009 10:40PM UTC.

    Suggested implementation

Change History (5)

Changed July 29, 2009 10:41PM UTC by nbubna comment:1

Just attached an updated patch with proper tabs, proper brace style and the correct success/status handler.

Changed November 18, 2010 03:14AM UTC by dmethvin comment:2

blockedby: → 7195
milestone: 1.41.5
status: newopen

Changed December 27, 2010 10:37PM UTC by rwaldron comment:3

keywords: → ajaxrewrite

Changed January 13, 2011 04:01PM UTC by jaubourg comment:4

resolution: → fixed
status: openclosed

Fixes #4964. Adds a statusCode object together with a new statusCode method on the jXHR object (deferred behaviour). They accept a map of statusCode/callback(s). Callbacks are fired when the status code of the response correponds to the key (as a success or an error callback depending on how the request completed). Unit tests added.

Changeset: 44fc87f66ca54278e37f15885a80c2407036df57

Changed January 31, 2011 04:27PM UTC by john comment:5

priority: minorhigh