There is a global variable var find; there is a function where I change the value of a global variable
function getMe(){ data={action:'myInfo'}; $.post('core.php', data, function(response){ obj= JSON.parse(response); $.each(obj, function(key, value){ find = value['find']; }); }); } And if I call the function
getMe(); console.log(find); then in the console undefined , why so?
console.log(find);runs beforefunction(response){ ... }. - Igor