From 4592595b478be979141ce35c693dbc6b65647173 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 --- src/manipulation/_evalUrl.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/manipulation/_evalUrl.js') diff --git a/src/manipulation/_evalUrl.js b/src/manipulation/_evalUrl.js index 54133fc9b..f88b747cc 100644 --- a/src/manipulation/_evalUrl.js +++ b/src/manipulation/_evalUrl.js @@ -1,6 +1,6 @@ import jQuery from "../ajax.js"; -jQuery._evalUrl = function( url, options ) { +jQuery._evalUrl = function( url, options, doc ) { return jQuery.ajax( { url: url, @@ -18,7 +18,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