function check () {
var result;
$.post('file.php', function(data) {
result = data;
});
return result;
}
I can't seem to get the result since its function(data) is asynchronous... how can I achieve that in a different way?
what I want to do is to get the echoed result from file.php via check() function call in javascript...