当我在输入文本框中输入城市和国家后单击按钮。那么警报值就来了。但在api中,它不能通过。当我在控制台中检入浏览器的开发人员工具时,错误显示。
[[PromiseValue]]: Object
cod: "404"
message: "city not found"
__proto__: Object
const App_key = "bbf6d56707d9126ae929a951187fca66";
const city = e.target.elements.city.value;
const country = e.target.elements.country.value;
const api_call = await fetch('http://api.openweathermap.org/data/2.5/weather?q=${city},${country}&APPID=bbf6d56707d9126ae929a951187fca66');
https://stackoverflow.com/questions/56569258
复制相似问题