tadam logo
Did you find an error in the text?
Select this with mouse and press
Ctrl + Enter
Xhtml.co.il Check Spelling
Orphus system

jQuery.globalEval()

jQuery.globalEval( code )

Description: Execute some JavaScript code globally.

Arguments

jQuery.globalEval( code )

version added: 1.0.4
code
JavaScript code
The 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).

Example

Execute a script in the global context.
function test(){
    jQuery.globalEval("var newVar = true;")
}
test();
// newVar === true
Was this information helpful?
   

Comments