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 a new issue