javascript global variable

R

rodchar

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

thanks,
rodchar
 
C

Cowboy \(Gregory A. Beamer\)

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,078
Latest member
MakersCBDBlood

Latest Threads

Top