Well, we can't reasonably land that as it's using browser-specific code. I'm a bit confused as to why it's even making it that far - if you're making a request to a remote domain then it should be throwing an exception and not continuing. I'll have to check into this further.
The xhr.status === 0 clause and accompanying comment are worse than browser-specific code. You're fixing one browser's bug at the expense of robustness in other browsers. Using jQuery.browser.opera here would make this code more, not less, browser-agnostic.
The xhr.status === 0 clause also causes aborted requests caused by connection problems to call the success callback (except in IE).
This results in several problems:
1) Inconsistent behavior across browsers, since the error callback is called in IE and other browsers (Firefox, Chrome, Opera) call success.
2) There is no way to determine when requests are aborted in browsers that would otherwise support it (Firefox, Chrome) without adding browser-specific code for those browsers to all success callbacks.
I have not found any way in Opera to distinguish between a 304 response and an aborted request.
Was going to post in the forum if somebody could please have a look at this as the regression is rendering jQuery 1.4 useless for long-polling applications where catching errors is vital. There have been a couple of bugs in the issue tracker, I think somebody dup-cleaned them up to this one recently.
Leave a comment on olau.jquery's reply
Change topic type
Link this topic
Provide the permalink of a topic that is related to this topic