From 15f4dec7894f1e00adbfb9bce4f870441a527bd6 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 Fixes gh-1887 Closes gh-1888 --- 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 6704749a..0fdacbce 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 b9d59fc4..ca3b8b54 100644 --- a/test/unit/manipulation.js +++ b/test/unit/manipulation.js @@ -2434,3 +2434,12 @@ test( "Validate creation of multiple quantities of certain elements (#13818)", 4 }); }); }); + +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.11.4.GIT