Search code examples
jquerygetscript

jQuery $.getScript - old functions & variables in executed script


i execute a javascript with jQuery $.getScript. In the executed script i haven't access to the functions and variables of my source file.

Is there a solution?


Solution

  • The script executed by $.getScript() does have access to the global context. You can use any global variable (or function for that matter) from within your external script.