Make sure prefilters have been called and transport has been selected before sending any global event (in case the "global" option has been changed).

This commit is contained in:
jaubourg 2011-01-09 16:32:51 +01:00
parent 63487505c6
commit c55a76a23f

View file

@ -532,14 +532,14 @@ jQuery.extend({
s.data = jQuery.param( s.data , s.traditional );
}
// Get transport
transport = jQuery.ajax.prefilter( s ).transport( s );
// Watch for a new set of requests
if ( s.global && jQuery.active++ === 0 ) {
jQuery.event.trigger( "ajaxStart" );
}
// Get transport
transport = jQuery.ajax.prefilter( s ).transport( s );
// If no transport, we auto-abort
if ( ! transport ) {