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
Jquery包含在页面中
(url from http://www.geonames.org/export/JSON-webservices.html)
(来自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?
我已经尝试在本地保存文件,因为用'test.json'替换url但是也没有。我在这里缺少任何想法或语法?
1 个解决方案
#1
2
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
点击浏览器中的网址:http://api.geonames.org/citiesJSON?north = 44.1&south =-9.9&event = 22.4&latest = 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."
您会看到“已经超出了2000个学分的每小时限制。请使用特定于应用程序的帐户。请勿将模拟帐户用于您的应用程序。”
#1
2
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
点击浏览器中的网址:http://api.geonames.org/citiesJSON?north = 44.1&south =-9.9&event = 22.4&latest = 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."
您会看到“已经超出了2000个学分的每小时限制。请使用特定于应用程序的帐户。请勿将模拟帐户用于您的应用程序。”