javascript global variable

javascript global variable

am 01.04.2008 16:48:02 von rodchar

hey all,
does each user get it's own copy of a javascript global variable?

thanks,
rodchar

Re: javascript global variable

am 01.04.2008 17:08:38 von NoSpamMgbworld

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" wrote in message
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

Re: javascript global variable

am 01.04.2008 17:17:02 von 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" wrote in message
> 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
>
>
>