73
rated 0 times
[
76]
[
3]
/ answers: 1 / hits: 44146
/ 13 Years ago, mon, august 1, 2011, 12:00:00
We have a lot of setup JS code that defines panels, buttons, etc that will be used in many other JS files.
Typically, we do something like:
grid.js
var myGrid = .....
combos.js
var myCombo = .....
Then, in our application code, we:
application.js
function blah() {
myGrid.someMethod()
}
someother.js
function foo() {
myCombo.someMethod();
myGrid.someMethod();
}
So, should we be using the var myGrid
or is better to use window.myGrid
What's the difference?
More From » global-variables