function get_url(){
var returnValue = null;
$.ajax({
async: false,
type: "GET",
url: "http://127.0.0.1:1337/?callback=?&command=get_url",
dataType: "json",
success: function(data){
data = $.parseJSON(data);
console.log(data[0].get_url); // "not_null"
returnValue = data[0].get_url;
}
});
console.log(returnValue); // "null"
return returnValue;
}
Why function don't return "not_null" ?