📜  天气 api javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:16.546000             🧑  作者: Mango

代码示例1
// Full tutorial: https://www.youtube.com/watch?v=WZNG8UomjSI

fetch(
  "https://api.openweathermap.org/data/2.5/weather?q=" +
    city +
    "&units=metric&appid=" +
    apiKey
)
  .then((response) => response.json())
  .then((data) => this.displayWeather(data));