I've come across some strange behavior in IE7.  Sometimes when an
XmlHttpRequest receives a 204 (No Content) HTTP status code on the
response, IE sets the XmlHttpRequest object's status property to
1223.  In my code, this seems to be happening when my server is
returning a 204 from a PUT request - IE seems to be handling the 204
from a DELETE request okay.

Anyhow, jQuery's httpSuccess function is (quite understandably)
interpreting the 1223 response as a failure.  I tacked on another
condition to the end of the if statement:

jQuery.browser.msie && r.status == 1223

This seems to fix the problem.  However, my overall jQuery knowledge
is pretty limited, so I'm not aware of any potential side effects.

A quick Google search turns up a few references to this bug on the
intertubes, but I can't find anything on MSDN (surprise surprise).
Yahoo's toolkit normalizes the 1223 response back to 204:


Any chance a fix for this can make it into the next version of jQuery?

Reply via email to