//my class
function myClass()
{
this.pubVar = 'hello public';
var priVar = 'hello private';
}
myClass.staticMethod = function()
{
//how do i access thos variables here
}
I tried alert(this.pubVar)
and alert(priVar)
with no success. What am I doing wrong?
I'm going to change the question a bit.. I didn't explain it well the first time through.
How do I declare static variables in a class?
I know with java it's simple, you just put static infront of the variable type and presto you've got a static variable. I can't seem to find that option for javascript..