This is an asynchronous call, so you cannot return from it like that.
You will need to move the code that does something with datato the callback ( function(data){}) function .
function getAreas(){
$.post("/custom_html/weathermap.php",'',
function(data){
}, "json");
}
, . , , , . , , . $.post weathermap.php, . . , - .
- ascii:
V
|
User clicks button
(or something else happens)
|
|
Your JavaScript runs
|
|
And eventually gets
to the ajax call
|
|
And your callback is run
on the data and execution
continues from here
|
|
V