diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2008-04-22 22:18:11 +0000 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2008-04-22 22:18:11 +0000 |
commit | d3d8f3561b833781a3b7735685e1df48d8e7a60a (patch) | |
tree | 649defdb212e0516b38e73a1cc3bfbccbc28682a /src/ajax.js | |
parent | e454e8305d7c159c3bcffafeb09ea98b342777ad (diff) | |
download | jquery-d3d8f3561b833781a3b7735685e1df48d8e7a60a.tar.gz jquery-d3d8f3561b833781a3b7735685e1df48d8e7a60a.zip |
jquery.ajax: fix for beforeSend-cancelling-sideeffects
Diffstat (limited to 'src/ajax.js')
-rw-r--r-- | src/ajax.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/ajax.js b/src/ajax.js index 4b84538df..ca17f4f0d 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -291,8 +291,13 @@ jQuery.extend({ } catch(e){} // Allow custom headers/mimetypes - if ( s.beforeSend && s.beforeSend(xml, s) === false ) + if ( s.beforeSend && s.beforeSend(xml, s) === false ) { + // cleanup active request counter + s.global && jQuery.active--; + // close opended socket + xml.abort(); return false; + } if ( s.global ) jQuery.event.trigger("ajaxSend", [xml, s]); |