Javascript: variable scope & the evils of globals
- by Nick
I'm trying to be good, I really am, but I can't see how to do it :)
Any advice on how to not use a global here would be greatly appreciated. Let's call the global G.
Function A
Builds G by AJAX
Function B
Uses G
Function C
Calls B
Called by numerous event handlers attached to DOM elements (type 1)
Function D
Calls B
Called by…