Commit d3fad51c authored by jaubourg's avatar jaubourg

Fixes #11264 or rather seriously limits the risk of global ajaxSettings...

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.
parent 484cea1b
...@@ -351,6 +351,8 @@ jQuery.fn.extend({ ...@@ -351,6 +351,8 @@ jQuery.fn.extend({
jQuery.each( scripts, function( i, elem ) { jQuery.each( scripts, function( i, elem ) {
if ( elem.src ) { if ( elem.src ) {
jQuery.ajax({ jQuery.ajax({
type: "GET",
global: false,
url: elem.src, url: elem.src,
async: false, async: false,
dataType: "script" dataType: "script"
......
ok( "<?php echo $_SERVER['REQUEST_METHOD'] ?>" === "GET", "request method is <?php echo $_SERVER['REQUEST_METHOD'] ?>" );
\ No newline at end of file
...@@ -2336,6 +2336,26 @@ test( "jQuery.ajax - loading binary data shouldn't throw an exception in IE (#11 ...@@ -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() { test("jQuery.ajax - active counter", function() {
ok( jQuery.active == 0, "ajax active counter should be zero: " + jQuery.active ); ok( jQuery.active == 0, "ajax active counter should be zero: " + jQuery.active );
}); });
......
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