diff options
author | jeresig <jeresig@gmail.com> | 2010-01-12 10:47:00 -0500 |
---|---|---|
committer | jeresig <jeresig@gmail.com> | 2010-01-12 10:47:00 -0500 |
commit | d60b19781095f508e32a590c7ee112817b0794ee (patch) | |
tree | 5989c365795c24718873212a6377c04078893736 | |
parent | c320e4f3c2174148e5c13276237abb01547d52f5 (diff) | |
download | jquery-d60b19781095f508e32a590c7ee112817b0794ee.tar.gz jquery-d60b19781095f508e32a590c7ee112817b0794ee.zip |
ajaxStop was getting called too many times, separated some of the logic into the abort method itself.
-rw-r--r-- | src/ajax.js | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/ajax.js b/src/ajax.js index 07e706c4c..e9b02fcd9 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -455,13 +455,16 @@ jQuery.extend({ var oldAbort = xhr.abort; xhr.abort = function() { oldAbort.call( xhr ); - if ( xhr ) { - xhr.readyState = 0; - } + if ( !requestDone ) { complete(); } - onreadystatechange(); + + if ( xhr ) { + xhr.onreadystatechange = null; + } + + requestDone = true; }; } catch(e) { } |