I know this was asked before, but I'm struggling to figure out what is wrong with my code as I am still getting a blank page:
JQuery is included in the page
(URL from http://www.geonames.org/export/JSON-webservices.html )
var url="http://api.geonames.org/citiesJSON?north=44.1&south=-9.9&east=-22.4&west=55.2&lang=de&username=demo";
$.getJSON(url, function (data) {
$.each(data.geonames, function (){
$('ul#results').append('<li><div class=\"name\">' +this.toponymName+ '</div></li>');
});
});
I tried to save the file locally, replacing the url with "test.json", but nothing there either. Any ideas or syntax I'm missing here?
source
share