sharing variables between javascript functions
Posted: Sat Jun 28, 2008 6:58 am
i have two javascript fuctions in my page and i want to have access to some variables of the first function within second function. how shoud i do that?
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
var my_variable = 'abc';
function a() { my_variable = 3; }
function b() { alert(my_variable); }