jQuery.globalEval( code )Returns: Anything
Description: Execute some JavaScript code globally.
-
version added: 1.0.4jQuery.globalEval( code )
-
codeType: StringThe JavaScript code to execute.
-
-
version added: 3.4jQuery.globalEval( code [, options ] )
-
codeType: StringThe JavaScript code to execute.
-
optionsType: PlainObject
-
nonceType: stringThe nonce attribute passed to the executed script.
-
-
-
version added: 3.5jQuery.globalEval( code [, options ] [, doc ] )
-
codeType: StringThe JavaScript code to execute.
-
optionsType: PlainObject
-
nonceType: stringThe nonce attribute passed to the executed script.
-
-
docType: DocumentA document in which context the code will be evaluated.
-
eval()
in that it's executed within the global context (which is important for loading external scripts dynamically).
Examples:
Example 1
1
2
3
4
5
|
|
Example 2
1
2
3
4
5
6
7
|
|