Bug Tracker

Opened 12 years ago

Closed 12 years ago

#7995 closed bug (invalid)

ajax query of type jsonp, when response is an http 204, does nothing.

Reported by: elij.mx@… Owned by: elij.mx@…
Priority: undecided Milestone: 1.next
Component: unfiled Version: 1.4.4
Keywords: Cc:
Blocked by: Blocking:

Description

If you make an ajax request of type jsonp, and the response is an http-204 response code (which specifies no body content), neither the success nor the error handler are called.

I stepped through a debugger with jquery 1.4.4, and hit this code.

6000 // Make sure that the request was successful or notmodified
6001 if ( status === "success" || status === "notmodified" ) {
6002     // JSONP handles its own success callback
6003     if ( !jsonp ) {
6004         jQuery.handleSuccess( s, xhr, status, data );
6005     }
6006 } else {
6007     jQuery.handleError( s, xhr, status, errMsg );
6008 } 

It appears that if the status is a success, and it is not a jsonp request, nothing happens -- after stepping through a bit more the function simply returns.

Earlier during the global eval, since it is a 204 response, data = "", and thus there is no jsonp callback function named to call.

Is this expected behavior? I would think in the case of a jsonp request, if there is no content (and thus no function named to call back into), the error handler should be called.

Change History (2)

comment:1 Changed 12 years ago by Rick Waldron

Owner: set to elij.mx@…
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!

comment:2 Changed 12 years ago by trac-o-bot

Resolution: invalid
Status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!

Note: See TracTickets for help on using tickets.