javascript global variable

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

thanks,
rodchar
rodchar [ Di, 01 April 2008 16:48 ] [ ID #1932650 ]

Re: javascript global variable

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" <rodchar [at] discussions.microsoft.com> wrote in message
news:B60495B5-9AF2-4B2C-9D49-A3539F502475 [at] microsoft.com...
> hey all,
> does each user get it's own copy of a javascript global variable?
>
> thanks,
> rodchar
NoSpamMgbworld [ Di, 01 April 2008 17:08 ] [ ID #1932653 ]

Re: javascript global variable

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" <rodchar [at] discussions.microsoft.com> wrote in message
> news:B60495B5-9AF2-4B2C-9D49-A3539F502475 [at] microsoft.com...
> > hey all,
> > does each user get it's own copy of a javascript global variable?
> >
> > thanks,
> > rodchar
>
>
>
rodchar [ Di, 01 April 2008 17:17 ] [ ID #1932657 ]
Microsoft » microsoft.public.dotnet.framework.aspnet » javascript global variable

Vorheriges Thema: asp.net 2.0 windows authentication
Nächstes Thema: where do i get material on dbms?