试图找出freecodecamp任务,但它甚至不工作,即使跟踪YouTube教程https://www.youtube.com/watch?v=XZXg_fuyYnI&t=1385s。 请帮忙,这段代码有什么问题?本地天气应用程序FreeCodeCamp
var API_KEY = "xxxxxxxxxxxxxxxxxxxxxx";
$(function() {
var loc;
$.getJSON('http://ipinfo.io', function (d) {
console.log("assigning the data...")
loc = d.loc.split(" , ");
console.log(loc);
$.getJSON('http://api.openweathermap.org/data/2.5/weather?lat=' + loc[0] + '&lon=' + loc[1] + '&APPID=' + API_KEY, function (wd) {
console.log("got the data ,", wd);
})
})
})
有没有发生错误? – DanilGholtsman
我现在唯一可以假设的
DanilGholtsman