javascript global variable
am 01.04.2008 16:48:02 von rodcharhey all,
does each user get it's own copy of a javascript global variable?
thanks,
rodchar
hey all,
does each user get it's own copy of a javascript global variable?
thanks,
rodchar
I am assuming you mean it this way:
//global variable
var a = 10;
function SomeFunction()
{
//changing global variable
a = 20;
//local variable
var b = 20;
}
In this case, the local and global variables both have page scope. Even if
you place these variables into files, they only exist as long as the page is
accessed.
So, yes, each user gets his own global variables.
--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA
Subscribe to my blog
http://gregorybeamer.spaces.live.com/lists/feed.rss
or just read it:
http://gregorybeamer.spaces.live.com/
*************************************************
| Think outside the box!
|
*************************************************
"rodchar"
news:B60495B5-9AF2-4B2C-9D49-A3539F502475@microsoft.com...
> hey all,
> does each user get it's own copy of a javascript global variable?
>
> thanks,
> rodchar
thank you for making sure we're on the right page, i appreciate the help,
rod.
"Cowboy (Gregory A. Beamer)" wrote:
> I am assuming you mean it this way:
>
> //global variable
> var a = 10;
>
> function SomeFunction()
> {
> //changing global variable
> a = 20;
>
> //local variable
> var b = 20;
> }
>
> In this case, the local and global variables both have page scope. Even if
> you place these variables into files, they only exist as long as the page is
> accessed.
>
> So, yes, each user gets his own global variables.
>
> --
> Gregory A. Beamer
> MVP, MCP: +I, SE, SD, DBA
>
> Subscribe to my blog
> http://gregorybeamer.spaces.live.com/lists/feed.rss
>
> or just read it:
> http://gregorybeamer.spaces.live.com/
>
> *************************************************
> | Think outside the box!
> |
> *************************************************
> "rodchar"
> news:B60495B5-9AF2-4B2C-9D49-A3539F502475@microsoft.com...
> > hey all,
> > does each user get it's own copy of a javascript global variable?
> >
> > thanks,
> > rodchar
>
>
>