Description: Execute some JavaScript code globally.
codeThe JavaScript code to execute.
This method behaves differently from using a normal JavaScript eval()
in that it's executed within the global context (which is important for loading external scripts dynamically).
function test(){
jQuery.globalEval("var newVar = true;")
}
test();
// newVar === true