Permalink
Browse files

Manipulation: support data-URI scripts insertion

Fixes gh-1887
Closes gh-1888
  • Loading branch information...
rhyzx authored and markelog committed Nov 28, 2014
1 parent 7d15b4d commit 15f4dec7894f1e00adbfb9bce4f870441a527bd6
Showing with 10 additions and 0 deletions.
  1. +1 −0 src/manipulation/_evalUrl.js
  2. +9 −0 test/unit/manipulation.js
@@ -7,6 +7,7 @@ jQuery._evalUrl = function( url ) {
url: url,
type: "GET",
dataType: "script",
cache: true,

This comment has been minimized.

Show comment
Hide comment
@gibson042

gibson042 Dec 3, 2014

Member

Why not add "data" to rlocalProtocol and do cache: rlocalProtocol.test( url ) here to preserve default no-cache behavior?

@gibson042

gibson042 Dec 3, 2014

Member

Why not add "data" to rlocalProtocol and do cache: rlocalProtocol.test( url ) here to preserve default no-cache behavior?

This comment has been minimized.

Show comment
Hide comment
@dmethvin

dmethvin Dec 3, 2014

Member

Ooh, sounds like a good idea.

@dmethvin

dmethvin Dec 3, 2014

Member

Ooh, sounds like a good idea.

This comment has been minimized.

Show comment
Hide comment
@markelog

markelog Dec 3, 2014

Member

Do we need no cached behaviour? I would suggest to comply with browser logic.

@markelog

markelog Dec 3, 2014

Member

Do we need no cached behaviour? I would suggest to comply with browser logic.

This comment has been minimized.

Show comment
Hide comment
@gibson042

gibson042 Dec 4, 2014

Member

Ah, you are right... this is only used for domManip <script src="…"></script> and I was just looking too hard at preexisting behavior.

@gibson042

gibson042 Dec 4, 2014

Member

Ah, you are right... this is only used for domManip <script src="…"></script> and I was just looking too hard at preexisting behavior.

async: false,
global: false,
"throws": true
@@ -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( "<script src=\"data:text/javascript,testFoo = 'foo';\"></script>" );
setTimeout(function() {
strictEqual( window[ "testFoo" ], "foo", "data-URI script executed" );
start();
}, 100 );
});

0 comments on commit 15f4dec

Please sign in to comment.