Skip to content

Commit bc1902d

Browse files
rhyzxmarkelog
authored andcommitted
Manipulation: support data-URI scripts insertion
Ref 15f4dec
1 parent fa70df6 commit bc1902d

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/manipulation/_evalUrl.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ jQuery._evalUrl = function( url ) {
77
url: url,
88
type: "GET",
99
dataType: "script",
10+
cache: true,
1011
async: false,
1112
global: false,
1213
"throws": true

test/unit/manipulation.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2461,3 +2461,12 @@ test( "Make sure jQuery.fn.remove can work on elements in documentFragment", 1,
24612461

24622462
equal( fragment.childNodes.length, 0, "div element was removed from documentFragment" );
24632463
});
2464+
2465+
asyncTest( "Insert script with data-URI (gh-1887)", 1, function() {
2466+
Globals.register( "testFoo" );
2467+
jQuery( "#qunit-fixture" ).append( "<script src=\"data:text/javascript,testFoo = 'foo';\"></script>" );
2468+
setTimeout(function (){
2469+
strictEqual( window[ "testFoo" ], "foo", "data-URI script executed" );
2470+
start();
2471+
}, 100 );
2472+
});

0 commit comments

Comments
 (0)