Im trying to create an ajax function to get some params of the DB each time, but when I call the ajax method it is not returning correctly, when I do it debug the value was ok, but the return result isn't works.
$(document).ready(function () {
function foo(mod){
var uri="some url";
$.ajax({
type: "GET",
url: uri,
}).done(function( data ) {
return data;
});
}
// alert to get the result is always printing undefined
alert(foo("param_1"));
});