Differentiating between various 2XX HTTP response status codes in ajax success callback
Hi. I would like for my success callbacks, in ajax calls, to receive
the actual 2XX status code as an argument. I want to be able to
differentiate between the different ones. The current 'status'
argument only holds the string 'success' as long as the code is in the
200 range (and also in the case of 304 "Not Modified").
Prototype makes available onXXX callbacks if desired, one for every
legal HTTP response status code. On principle, a Javascript package
should not reduce that functionality to only success vs. error (though
I understand the actual exception object is passed to the 'error'
callback).
In the immediate case, I wanted to test for 200 'OK' vs. 204 'No
Content'. Of course it is easy to work around testing for empty
content, no problem. Still I thought I'd send this note on principle
and see if there's support for the issue.
Eric