diff options
author | Thomas Park <thomas@thomaspark.me> | 2015-01-22 22:36:20 -0500 |
---|---|---|
committer | Thomas Park <thomas@thomaspark.me> | 2015-01-22 22:36:20 -0500 |
commit | 25f57ee1fe9773b08d95d5f7d6ba93e2db048f8f (patch) | |
tree | 8e4448eed6bce0fa1288321e18c2b4675b8cb393 /bower_components/jquery/src/ajax.js | |
parent | 0a7f9e5bb684c185d309d1ac1079dfb8b36af33c (diff) |
update bootstrap to 3.3.2
Diffstat (limited to 'bower_components/jquery/src/ajax.js')
-rw-r--r-- | bower_components/jquery/src/ajax.js | 42 |
1 files changed, 11 insertions, 31 deletions
diff --git a/bower_components/jquery/src/ajax.js b/bower_components/jquery/src/ajax.js index d39de2a9..5c7b4add 100644 --- a/bower_components/jquery/src/ajax.js +++ b/bower_components/jquery/src/ajax.js @@ -10,10 +10,6 @@ define([ ], function( jQuery, rnotwhite, nonce, rquery ) { var - // Document location - ajaxLocParts, - ajaxLocation, - rhash = /#.*$/, rts = /([?&])_=[^&]*/, rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, @@ -42,22 +38,13 @@ var transports = {}, // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression - allTypes = "*/".concat("*"); - -// #8138, IE may throw an exception when accessing -// a field from window.location if document.domain has been set -try { - ajaxLocation = location.href; -} catch( e ) { - // Use the href attribute of an A element - // since IE will modify it given document.location - ajaxLocation = document.createElement( "a" ); - ajaxLocation.href = ""; - ajaxLocation = ajaxLocation.href; -} + allTypes = "*/".concat( "*" ), + + // Document location + ajaxLocation = window.location.href, -// Segment location into parts -ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || []; + // Segment location into parts + ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || []; // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport function addToPrefiltersOrTransports( structure ) { @@ -536,7 +523,8 @@ jQuery.extend({ } // We can fire global events as of now if asked to - fireGlobals = s.global; + // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118) + fireGlobals = jQuery.event && s.global; // Watch for a new set of requests if ( fireGlobals && jQuery.active++ === 0 ) { @@ -609,7 +597,7 @@ jQuery.extend({ return jqXHR.abort(); } - // aborting is no longer a cancellation + // Aborting is no longer a cancellation strAbort = "abort"; // Install callbacks on deferreds @@ -721,8 +709,7 @@ jQuery.extend({ isSuccess = !error; } } else { - // We extract error from statusText - // then normalize statusText and status for non-aborts + // Extract error from statusText and normalize for non-aborts error = statusText; if ( status || !statusText ) { statusText = "error"; @@ -778,7 +765,7 @@ jQuery.extend({ jQuery.each( [ "get", "post" ], function( i, method ) { jQuery[ method ] = function( url, data, callback, type ) { - // shift arguments if data argument was omitted + // Shift arguments if data argument was omitted if ( jQuery.isFunction( data ) ) { type = type || callback; callback = data; @@ -795,12 +782,5 @@ jQuery.each( [ "get", "post" ], function( i, method ) { }; }); -// Attach a bunch of functions for handling common AJAX events -jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ) { - jQuery.fn[ type ] = function( fn ) { - return this.on( type, fn ); - }; -}); - return jQuery; }); |