variable scope across script instances
what is the scope of ‘attributes’ defined with the declareattribute() function? are these also globals? or are they more protected than that?
If you declare the variable with "var" it’s local to that instance of the js. If you don’t, it’s global to all instances of js object (regardless of the js file used), ie:
var unique = 1;
shared = 2;
shared variable, I would recommend using the Global object (p. 29, in
great – thank you!
Quote: Emmanuel Jourdan wrote on Fri, 16 June 2006 20:16
Do you mean it’s considered a bug and may change?
Not that I’m ever using the non-var global, I always use the global object, but others may be making use of it…
On 19 juin 06, at 02:40, John Pitcairn wrote:
> Do you mean it’s considered a bug and may change?
> Not that I’m ever using the non-var global, I always use the global
> object, but others may be making use of it…
I remember Joshua said something about that… He might confirm or