-
- // IE - #1450: sometimes returns 1223 when it should be 204
- if ( status === 1223 ) {
- status = 204;
- // Status 0 encompasses several cases
- } else if ( !status ) {
- // Cross-domain
- if ( s.crossDomain ) {
- if ( !s.statusText ) {
- // FF, Webkit (other?): There is no status text for errors
- // 302 is the most generic cross-domain status code
- // for errors, could be anything really (even a real 0)
- status = 302;
- }
- // All same-domain - #8125, #8152: for local files, 0 is a success
- } else if( s.isLocal ) {
- status = 200;
- }
- // Opera - #6060: sets status as 0 for 304
- // and there doesn't seem to be any way to
- // detect this case. Patch VERY welcome.
- }
+ status =
+ // If the request is local and we have data: assume a success
+ // (success with no data won't get notified, that's the best we
+ // can do given current implementations)
+ !status && s.isLocal ?
+ ( responses.text ? 200 : 404 ) :
+ // IE - #1450: sometimes returns 1223 when it should be 204
+ ( status === 1223 ? 204 : status );