mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
2.0: Reduce globalEval
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
This commit is contained in:
parent
155dbad029
commit
f300c5c2f3
12
src/core.js
12
src/core.js
@ -504,16 +504,10 @@ jQuery.extend({
|
||||
noop: function() {},
|
||||
|
||||
// Evaluates a script in a global context
|
||||
// Workarounds based on findings by Jim Driscoll
|
||||
// http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
|
||||
globalEval: function( data ) {
|
||||
if ( data && jQuery.trim( data ) ) {
|
||||
// We use execScript on Internet Explorer
|
||||
// We use an anonymous function so that context is window
|
||||
// rather than jQuery in Firefox
|
||||
( window.execScript || function( data ) {
|
||||
window[ "eval" ].call( window, data );
|
||||
} )( data );
|
||||
var indirect = eval;
|
||||
if ( jQuery.trim( data ) ) {
|
||||
indirect( data + ";" );
|
||||
}
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user