aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/ajax.js
diff options
context:
space:
mode:
authorjaubourg <j@ubourg.net>2012-03-07 16:54:05 +0100
committerjaubourg <j@ubourg.net>2012-03-07 16:54:05 +0100
commitd3fad51cad1f71bd20beba81b51552295721a5a5 (patch)
treea27eb97bc43bca57ac6aaa1eb02804e9bf506bc4 /test/unit/ajax.js
parent484cea1b5651d215a24d3a6827663a4e16a6a253 (diff)
downloadjquery-d3fad51cad1f71bd20beba81b51552295721a5a5.tar.gz
jquery-d3fad51cad1f71bd20beba81b51552295721a5a5.zip
Fixes #11264 or rather seriously limits the risk of global ajaxSettings screwing with script loading in domManip. Gotta love globals and sneaky dependencies. Unit test added.
Diffstat (limited to 'test/unit/ajax.js')
-rw-r--r--test/unit/ajax.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/unit/ajax.js b/test/unit/ajax.js
index cca457db1..163ba4f05 100644
--- a/test/unit/ajax.js
+++ b/test/unit/ajax.js
@@ -2336,6 +2336,26 @@ test( "jQuery.ajax - loading binary data shouldn't throw an exception in IE (#11
});
});
+test( "jQuery.domManip - no side effect because of ajaxSetup or global events (#11264)", function() {
+ expect( 1 );
+
+ jQuery.ajaxSetup({
+ type: "POST"
+ });
+
+ jQuery( document ).bind( "ajaxStart ajaxStop", function() {
+ ok( false, "Global event triggered" );
+ });
+
+ jQuery( "#qunit-fixture" ).append( "<script src='data/evalScript.php'></script>" );
+
+ jQuery( document ).unbind( "ajaxStart ajaxStop" );
+
+ jQuery.ajaxSetup({
+ type: "GET"
+ });
+});
+
test("jQuery.ajax - active counter", function() {
ok( jQuery.active == 0, "ajax active counter should be zero: " + jQuery.active );
});