I have function:
function test(){
   $.post('data.php', function(val){
       return val;
   })
   return 'error';
}
and i use this simply:
console.log(test());
post is doing - return good value, but function test return me 'error' instead of value from data.php. Is possible get value from $.post? If yes, how?
 
     
     
     
    