Hello readers,
How do I access value of a global variable in a function.
I tried using window.UserName But it doesnt work.
I think I am going wrong somewhere....
any help or suggestions plz..
Thanks & regards,
How do I access value of a global variable in a function.
Code:
var UserName; //declared global
function1(UName) // this function is called onLoad event and UName is passed
{
UserName = UName;
}
function2()
{
-->//how to get the value of UserName here which is set in above function
}
I think I am going wrong somewhere....
any help or suggestions plz..
Thanks & regards,
Comment