jQuery.ajax triggers success callback on readyState=4,status=0

jQuery.ajax triggers success callback on readyState=4,status=0

jQuery.ajax({
  url: 'http://somewebsitethatdoesnotexist.com',
  success: function(){ console.log('yay') },
  error: function(){ console.log('boo') }
})

will print out 'yay' to the console.


I'm not sure of the right way to fix it, but the most obvious hack is to:

@@ -5158,7 +5158,7 @@ jQuery.extend({
                        return !xhr.status && location.protocol === "file:" ||
                                // Opera returns 0 when status is 304
                                ( xhr.status >= 200 && xhr.status < 300 ) ||
-                               xhr.status === 304 || xhr.status === 1223 || xhr.status === 0;
+                               xhr.status === 304 || xhr.status === 1223 || (jQuery.browser.opera && xhr.status === 0);
                } catch(e) {}
 
                return false;