ajaxStop was getting called too many times, separated some of the logic into the abort method itself.
This commit is contained in:
parent
c320e4f3c2
commit
d60b197810
11
src/ajax.js
11
src/ajax.js
|
@ -455,13 +455,16 @@ jQuery.extend({
|
||||||
var oldAbort = xhr.abort;
|
var oldAbort = xhr.abort;
|
||||||
xhr.abort = function() {
|
xhr.abort = function() {
|
||||||
oldAbort.call( xhr );
|
oldAbort.call( xhr );
|
||||||
if ( xhr ) {
|
|
||||||
xhr.readyState = 0;
|
|
||||||
}
|
|
||||||
if ( !requestDone ) {
|
if ( !requestDone ) {
|
||||||
complete();
|
complete();
|
||||||
}
|
}
|
||||||
onreadystatechange();
|
|
||||||
|
if ( xhr ) {
|
||||||
|
xhr.onreadystatechange = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
requestDone = true;
|
||||||
};
|
};
|
||||||
} catch(e) { }
|
} catch(e) { }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue