I know this has been asked before, but I'm struggling to see what is wrong with my code here as I'm 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've tried saving the file locally as replacing the url with 'test.json' but nothing there too. Any ideas or syntax I'm missing here?
'<li><div class=\"name\">'. Use'<li><div class="name">'since it is surrounded already by single quotes, not double quotes.