Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Displaying Json data from example url

Tags:

json

jquery

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?

like image 500
sledgeweight Avatar asked Nov 04 '22 02:11

sledgeweight


1 Answers

Hit the url from your browser: http://api.geonames.org/citiesJSON?north=44.1&south=-9.9&east=-22.4&west=55.2&lang=de&username=demo

You'll see that the "the hourly limit of 2000 credits for demo has been exceeded. Please use an application specific account. Do not use the demo account for your application."

like image 81
roman m Avatar answered Nov 08 '22 08:11

roman m