aboutsummaryrefslogtreecommitdiffstats
path: root/src/manipulation/_evalUrl.js
diff options
context:
space:
mode:
authorMichał Gołębiowski-Owczarek <m.goleb@gmail.com>2020-02-10 19:17:22 +0100
committerGitHub <noreply@github.com>2020-02-10 19:17:22 +0100
commit4592595b478be979141ce35c693dbc6b65647173 (patch)
tree03020ecb8c12dc18efcdda7987c9d73595ae1202 /src/manipulation/_evalUrl.js
parent18db87172cffbe48b92e30b70249e304863a70f9 (diff)
downloadjquery-4592595b478be979141ce35c693dbc6b65647173.tar.gz
jquery-4592595b478be979141ce35c693dbc6b65647173.zip
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
Diffstat (limited to 'src/manipulation/_evalUrl.js')
-rw-r--r--src/manipulation/_evalUrl.js4
1 files changed, 2 insertions, 2 deletions
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 );
}
} );
};