Commit 479e37f4 authored by TJ VanToll's avatar TJ VanToll Committed by Timmy Willison

Ajax: Support usage without jQuery.event

Fixes #15118
Closes gh-1588
parent 8530a2fc
...@@ -537,7 +537,8 @@ jQuery.extend({ ...@@ -537,7 +537,8 @@ jQuery.extend({
} }
// We can fire global events as of now if asked to // 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 // Watch for a new set of requests
if ( fireGlobals && jQuery.active++ === 0 ) { if ( fireGlobals && jQuery.active++ === 0 ) {
......
...@@ -415,6 +415,22 @@ module( "ajax", { ...@@ -415,6 +415,22 @@ module( "ajax", {
}; };
}); });
ajaxTest( "#15118 - jQuery.ajax() - function without jQuery.event", 1, function() {
var holder;
return {
url: url( "data/json.php" ),
setup: function() {
holder = jQuery.event;
delete jQuery.event;
},
complete: function() {
ok( true, "Call can be made without jQuery.event" );
jQuery.event = holder;
},
success: true
};
});
ajaxTest( "jQuery.ajax() - context modification", 1, { ajaxTest( "jQuery.ajax() - context modification", 1, {
url: url("data/name.html"), url: url("data/name.html"),
context: {}, context: {},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment