Rodriguesjax Blog
Rodriguesjax is here...
Wednesday, July 29, 2009
Make javascript variables global
Email This
BlogThis!
Share to X
Share to Facebook
Share to Pinterest
To make a variable just define it outside the scope of your functions
Eg:
var myvar=5;
fun();
myvar=1;
fun();
function fun()
{
//code goes here.
alert(myvar);
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment