I have this function
function get_last(){
$.ajax({
url:'fronta.php?get_last&last=1',
success:function(data) {
var last = parseInt(data);
}
});
return last;
}
but when I call it like
var last = get_last();
alert(last);
firebug gives me "last is not defined"
How can I pass this last variable into global scope ?