From bc1902ddc08502d60ee77e00ea95d454666d7e56 Mon Sep 17 00:00:00 2001 From: Bin Xin Date: Fri, 28 Nov 2014 14:09:29 +0800 Subject: [PATCH] Manipulation: support data-URI scripts insertion Ref 15f4dec7894f1e00adbfb9bce4f870441a527bd6 --- src/manipulation/_evalUrl.js | 1 + test/unit/manipulation.js | 9 +++++++++ 2 files changed, 10 insertions(+) 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 ); +}); -- 2.39.5