Bug Tracker

Modify

Ticket #7995 (closed bug: invalid)

Opened 2 years ago

Last modified 2 years ago

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:
Blocking: Blocked by:

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

comment:1 Changed 2 years ago by rwaldron

  • Owner set to elij.mx@…
  • Status changed from new to pending

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 2 years ago by trac-o-bot

  • Status changed from pending to closed
  • Resolution set to invalid

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!

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.