Is it possible to return the value of a jquery post into a normal js function like that ?
function get_err(req) {
var error = $.post("get_err.php", { error: req },
function(data) { return data; }, "text");
}
If I set alert(data); it's working, but i don't need it to be alerted, i need it to be returned so i can use it like here:
success: function(data) {
$("#error").html(get_err(data));
}