試圖找出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