Hi guys, this is the first time I’m REALLY stucked. Thing is I have this code:
function getLon(){
var lon;
$.getJSON("http://ip-api.com/json", function(pos){
lon = (pos.lon).toString();
});
return lon; };
And (of course) lon isn’t in the scope of the outer function, so it doesn’t return anything. My question is, how could I return the lon value using the $.getJSON?
Thanks.