Skip to content
Permalink
Browse files

jquery.ajax: fix for beforeSend-cancelling-sideeffects

  • Loading branch information
jzaefferer committed Apr 22, 2008
1 parent e454e83 commit d3d8f3561b833781a3b7735685e1df48d8e7a60a
Showing with 6 additions and 1 deletion.
  1. +6 −1 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]);

0 comments on commit d3d8f35

Please sign in to comment.
You can’t perform that action at this time.