Forums > Javascript

global variables

July 18, 2006 | 2:53 pm

Hello everyone.

To have a global variable in Javascript, it is just needed that it is declared before and outside of functions we write, right ?

But will this global variable be global to the patch in which the [js] object is nested as well ?

thx
Manu



Nat
July 22, 2006 | 11:17 pm

If you create a variable outside functions (in global code) it will be global to the JS object that loads your code. If you want a global that is global to all JS objects and max, check for the Global object in the Javascript documentation.


Viewing 2 posts - 1 through 2 (of 2 total)