Make Variable Global
Posted: Wed Jun 01, 2011 7:38 pm
How can I make my alert work? Right now it is undefined and I need to make my function in the variable global. Can this be done?
if (json_goals === undefined) { ajax.get('/assets/ajax/user_goals.php', function (resp) { var json_goals = resp; return json_goals; }); } alert(json_goals);