complete() called twice in error condition
|Reported by:||noel_bush||Owned by:|
In $.ajax(), line 5251 starts a try/catch that calls send() on the xhr. As part of the send operation, the onreadystatechange() function is called (line 5163), and in some circumstances, complete() is called (line 5214). One of these circumstances is when the server is not available. An XMLHttpRequestException with code 101 / name NETWORK_ERR is thrown, and caught by the catch clause (line 5253), which then calls complete() again.
The documentation doesn't mention that complete() might be called twice.
(All line numbers are from the (non-compressed) v1.4.2.)