From d60b19781095f508e32a590c7ee112817b0794ee Mon Sep 17 00:00:00 2001 From: jeresig Date: Tue, 12 Jan 2010 10:47:00 -0500 Subject: [PATCH] ajaxStop was getting called too many times, separated some of the logic into the abort method itself. --- src/ajax.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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) { } -- 1.7.10.4