mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
jquery.ajax: fix for beforeSend-cancelling-sideeffects
This commit is contained in:
parent
e454e8305d
commit
d3d8f3561b
@ -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]);
|
||||
|
Loading…
Reference in New Issue
Block a user