diff --git a/src/manipulation/_evalUrl.js b/src/manipulation/_evalUrl.js index 6704749ae..0fdacbcee 100644 --- a/src/manipulation/_evalUrl.js +++ b/src/manipulation/_evalUrl.js @@ -7,6 +7,7 @@ jQuery._evalUrl = function( url ) { url: url, type: "GET", dataType: "script", + cache: true, async: false, global: false, "throws": true diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js index e2bfd75b1..f4918b59a 100644 --- a/test/unit/manipulation.js +++ b/test/unit/manipulation.js @@ -2461,3 +2461,12 @@ test( "Make sure jQuery.fn.remove can work on elements in documentFragment", 1, equal( fragment.childNodes.length, 0, "div element was removed from documentFragment" ); }); + +asyncTest( "Insert script with data-URI (gh-1887)", 1, function() { + Globals.register( "testFoo" ); + jQuery( "#qunit-fixture" ).append( "" ); + setTimeout(function (){ + strictEqual( window[ "testFoo" ], "foo", "data-URI script executed" ); + start(); + }, 100 ); +});