aboutsummaryrefslogtreecommitdiffstats
path: root/src/core.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/core.js')
-rw-r--r--src/core.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/core.js b/src/core.js
index 8e43547ac..9095213eb 100644
--- a/src/core.js
+++ b/src/core.js
@@ -258,11 +258,12 @@ jQuery.extend( {
},
// Evaluates a script in a global context
- globalEval: function( code ) {
- var script = document.createElement( "script" );
+ globalEval: function( code, context ) {
+ context = context || document;
+ var script = context.createElement( "script" );
script.text = code;
- document.head.appendChild( script ).parentNode.removeChild( script );
+ context.head.appendChild( script ).parentNode.removeChild( script );
},
// Convert dashed to camelCase; used by the css and data modules