From: Bin Xin Date: Fri, 28 Nov 2014 06:09:29 +0000 (+0800) Subject: Manipulation: support data-URI scripts insertion X-Git-Tag: 3.0.0-alpha1+compat~199 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=bc1902ddc08502d60ee77e00ea95d454666d7e56;p=jquery.git Manipulation: support data-URI scripts insertion Ref 15f4dec7894f1e00adbfb9bce4f870441a527bd6 --- 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 ); +});