jquery.ajax: fix for beforeSend-cancelling-sideeffects

This commit is contained in:
Jörn Zaefferer 2008-04-22 22:18:11 +00:00
parent e454e8305d
commit d3d8f3561b

View file

@ -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]);