Re: [XHR] remove "user cancels request"

> can i ask, how do you use the "abort" event handler?
> and "error" event handler"

In jQuery 1.x, we don't even use onsuccess, onerror and onabort. Reason
being onreadystatechange is the only cross-browser means to handle
XMLHttpRequest when you have to support old IEs (and we try and avoid
having multiple code paths in jQuery because of size, maintainability and
behavioural consistency).

In jQuery 2.x, we use onload and onerror, not onabort. We have some
short-circuit logic in $.ajax to notify author's initiated aborts as errors
with a "cancelled" status but we ignore all other sources of aborts. The
idea is to ignore onunload aborts so that jQuery devs don't have to special
case for it in their error handlers.

Now, to get back to the subject at hand, like Glenn said, it's probably
better to notify those not-author-initiated aborts as errors, because from
the author's POW they're hardly aborts. However, if we do so, we have to
make sure it's possible to differentiate them from a network error. jQuery,
as an author, can then choose to ignore them or bubble them up in $.ajax,
not sure what's best for us at this point but that's another story entirely.

Received on Tuesday, 26 February 2013 12:31:21 UTC