From: jeresig <jeresig@gmail.com>
Date: Tue, 12 Jan 2010 15:47:00 +0000 (-0500)
Subject: ajaxStop was getting called too many times, separated some of the logic into the... 
X-Git-Url: http://git.asbjorn.biz/?a=commitdiff_plain;h=d60b19781095f508e32a590c7ee112817b0794ee;p=jquery.git

ajaxStop was getting called too many times, separated some of the logic into the abort method itself.
---

diff --git a/src/ajax.js b/src/ajax.js
index 07e706c..e9b02fc 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) { }