0
我检查了链接,它完美地工作。这是我在控制台收到错误:
GET http://localhost:60789/api.openweathermap.org/data/2.5/weather?q=Tel%20Aviv%2CIL&units=metric&APPID=the给定数量的404(未找到)
$(document).ready(function() {
var getIP = 'http://ip-api.com/json';
var openWeatherMap = 'api.openweathermap.org/data/2.5/weather'
$.getJSON(getIP).done(function(location) {
$.getJSON(openWeatherMap, {
q: location.regionName + "," + location.countryCode,
units: 'metric',
APPID: 'Here iam giving my appid'
}).done(function (weather) {
console.log(weather);
$('ul:first-child').html(weather.name + "," + weather.sys.country);
})
});
});
GET请求清楚地显示了问题...有人没有使用绝对链接。 – epascarello