PDA

View Full Version : Accessing variable from one js to another js



vms.saran
12 Aug 2010, 12:45 AM
Hi all..

i am new to Extjs...

can anyone help me how to access a variable from one js file to another js file..?

jarrednicholls
12 Aug 2010, 12:55 PM
It depends on the scope of the variables. If the variables are within a globally accessible scope, e.g., an object or an instance of a class, then you can reach the variable one way or another. If the variable is within a "closure" or local to a function, then there is a chance it is not publicly accessible.

Maybe if you have a particular case scenario I can help you understand scoping of your variables, etc. Here is also a good response on Stack Overflow on variable scope: http://stackoverflow.com/questions/500431/javascript-variable-scope