Created
August 25, 2014 05:47
-
-
Save zdying/ebd0ca72dde5253966fd to your computer and use it in GitHub Desktop.
Evaluates a script in a global context
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// from jQuery | |
// Evaluates a script in a global context | |
globalEval: function( code ) { | |
var script = document.createElement( "script" ); | |
script.text = code; | |
document.head.appendChild( script ).parentNode.removeChild( script ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment