From 3dedc3f2d46d38296f6867ca69c970e512f87e16 Mon Sep 17 00:00:00 2001 From: Michał Gołębiowski-Owczarek Date: Mon, 10 Feb 2020 19:17:22 +0100 Subject: Core: Fire iframe script in its context, add doc param in globalEval 1. Support passing custom document to jQuery.globalEval; the script will be invoked in the context of this document. 2. Fire external scripts appended to iframe contents in that iframe context; this was already supported & tested for inline scripts but not for external ones. Fixes gh-4518 Closes gh-4601 (cherry picked from commit 4592595b478be979141ce35c693dbc6b65647173) --- src/manipulation/_evalUrl.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/manipulation') diff --git a/src/manipulation/_evalUrl.js b/src/manipulation/_evalUrl.js index 9a4d2ac6f..6163b68c4 100644 --- a/src/manipulation/_evalUrl.js +++ b/src/manipulation/_evalUrl.js @@ -4,7 +4,7 @@ define( [ "use strict"; -jQuery._evalUrl = function( url, options ) { +jQuery._evalUrl = function( url, options, doc ) { return jQuery.ajax( { url: url, @@ -22,7 +22,7 @@ jQuery._evalUrl = function( url, options ) { "text script": function() {} }, dataFilter: function( response ) { - jQuery.globalEval( response, options ); + jQuery.globalEval( response, options, doc ); } } ); }; -- cgit v1.2.3