Skip to content

Commit

Permalink
Manipulation: support data-URI scripts insertion
Browse files Browse the repository at this point in the history
  • Loading branch information
rhyzx authored and markelog committed Dec 3, 2014
1 parent fa70df6 commit bc1902d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/manipulation/_evalUrl.js
Expand Up @@ -7,6 +7,7 @@ jQuery._evalUrl = function( url ) {
url: url,
type: "GET",
dataType: "script",
cache: true,
async: false,
global: false,
"throws": true
Expand Down
9 changes: 9 additions & 0 deletions test/unit/manipulation.js
Expand Up @@ -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( "<script src=\"data:text/javascript,testFoo = 'foo';\"></script>" );
setTimeout(function (){
strictEqual( window[ "testFoo" ], "foo", "data-URI script executed" );
start();
}, 100 );
});

0 comments on commit bc1902d

Please sign in to comment.