jquery.ajax: fix for beforeSend-cancelling-sideeffects
This commit is contained in:
parent
e454e8305d
commit
d3d8f3561b
|
@ -291,8 +291,13 @@ jQuery.extend({
|
||||||
} catch(e){}
|
} catch(e){}
|
||||||
|
|
||||||
// Allow custom headers/mimetypes
|
// 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;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if ( s.global )
|
if ( s.global )
|
||||||
jQuery.event.trigger("ajaxSend", [xml, s]);
|
jQuery.event.trigger("ajaxSend", [xml, s]);
|
||||||
|
|
Loading…
Reference in a new issue