summaryrefslogtreecommitdiffstats
path: root/js/vendor/jquery/src/ajax.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/vendor/jquery/src/ajax.js')
-rw-r--r--js/vendor/jquery/src/ajax.js42
1 files changed, 11 insertions, 31 deletions
diff --git a/js/vendor/jquery/src/ajax.js b/js/vendor/jquery/src/ajax.js
index d39de2a9b..5c7b4addb 100644
--- a/js/vendor/jquery/src/ajax.js
+++ b/js/vendor/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;
});