I have a problem with this function
function readComm(){
$.post("something.php", {read:"read"}, function(data){
retVal = $.trim(data).toString();
console.log(retVal);
return retVal;
});
}
It should call php file, and read some value from a text file. It does that as it should, and prints it on my console correctly, from a function. The problem is when I want to use that value in another function. It says that the value is undefined. retVal is a global variable, so that's not a problem.
Does anyone have an idea what could be the problem?