Bug Tracker

Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#7019 closed bug (invalid)

AJAX DELETE request never completes in IE

Reported by: MoonScript Owned by: MoonScript
Priority: low Milestone:
Component: ajax Version: 1.4.2
Keywords: DELETE readyState onreadystatechange needsreview Cc: snover
Blocked by: Blocking:

Description

When you issue an AJAX DELETE request, IE stops at readyState 2 (headers received), so the success/error/complete callback functions never get executed. This makes sense since DELETE (and PUT) requests should return an HTTP 204 (No Content) response, so there is no body. You might have to add another else-if in your onreadystatechange handler when the request type is 'DELETE', to fire the success and complete callbacks when readyState === 2. Or, in a future version of jQuery, provide another $.ajax option that would provide the means to override the onreadystatechange handler with your own custom code.

Note: I kept getting an 'Unspecified error' in IE when I tried to check the XHR's status property at readyState 2, so I was never able to call the error callback.

Change History (7)

comment:1 Changed 9 years ago by snover

Cc: snover added
Priority: low

Does the DELETE call to the server actually succeed? Methods other than GET and POST have traditionally not been well-supported across all browsers.

comment:2 Changed 9 years ago by snover

Keywords: needsreview added

comment:3 in reply to:  1 ; Changed 9 years ago by MoonScript

Replying to snover:

Does the DELETE call to the server actually succeed? Methods other than GET and POST have traditionally not been well-supported across all browsers.

Yes, the DELETE request does hit the server successfully. I am able to monitor the HTTP traffic using Fiddler, and I can see the request being made, and the HTTP 204 response being received.

Also, I just verified that the same problem is happening in the Safari browser (not Chrome, though). It stops at readyState===2.

comment:4 Changed 9 years ago by snover

Status: newopen

comment:5 in reply to:  3 Changed 9 years ago by MoonScript

Replying to MoonScript:

Replying to snover:

Does the DELETE call to the server actually succeed? Methods other than GET and POST have traditionally not been well-supported across all browsers.

Yes, the DELETE request does hit the server successfully. I am able to monitor the HTTP traffic using Fiddler, and I can see the request being made, and the HTTP 204 response being received.

Also, I just verified that the same problem is happening in the Safari browser (not Chrome, though). It stops at readyState===2.

P.S. I am also seeing this problem in Safari when using the PUT method.

comment:6 Changed 9 years ago by dmethvin

Owner: set to MoonScript
Status: openpending

We haven't gotten very far without code. Can you provide some? A jsfiddle test case would be ideal but if you have something site-specific please put a page up there.

comment:7 Changed 9 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.