declare var general
Moderator: jeanmichel
declare var general
I need to declare a var somewhere in axes that I can use your content anywhere
Re: declare var general
Hi
You can add your variable in USERENV like this:
then when you want to assign a value in your script just use:
and when you want to read it just access USERENV.OneGeneralVariable, for example:
You can add your variable in USERENV like this:
Code: Select all
/* <--- Note the comma */
/* ------------------------------------------------ */
OneGeneralVariable : "", /* One general variable everyone can access */
/* ------------------------------------------------ */
Code: Select all
USERENV.OneGeneralVariable = "Hello";Code: Select all
alert(USERENV.OneGeneralVariable);
USERENV.OneGeneralVariable = 'Bye'