Skip to main content

Bug Tracker

Side navigation

#5080 closed bug (invalid)

Opened August 20, 2009 12:39AM UTC

Closed August 20, 2009 02:39AM UTC

$.ajax 'error' and 'complete' callbacks ignore dataType.

Reported by: micah Owned by:
Priority: major Milestone: 1.4
Component: ajax Version: 1.3.2
Keywords: ajax complete callback datatype Cc:
Blocked by: Blocking:
Description

$.ajax will always pass the xhr to s.error and s.complete, without regard for the dataType argument (see http://dev.jquery.com/browser/trunk/jquery/src/ajax.js#L476).

I initially thought my code was screwy, as I expected the first argument of any callback to be the json response when dataType == 'json'. Is there a specific reason for this discrepancy in the API?

Attachments (0)
Change History (1)

Changed August 20, 2009 02:39AM UTC by dmethvin comment:1

resolution: → invalid
status: newclosed

Most likely because the easy case is when things go right. :)

All I can say is that it's working as documented, and I can't imagine it being changed since a lot of code depends on the current documented behavior. With that in mind I'll close the bug, but you could start a discussion on the jQuery-dev group.