【发布时间】:2020-07-22 22:16:53
【问题描述】:
我正在尝试使用 jQuery 函数 getJSON 从 openweathermap.org 获取数据,但出现了一些问题
var apiKey = "54df40e238084fbf095d3540271e48a0";
var URL = "api.openweathermap.org/data/2.5/weather?q=London&appid=" + apiKey;
$(document).ready(function() {
$.getJSON(URL, function(data) {
console.log(data);
})
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
【问题讨论】:
-
嗨,你能澄清一下这个问题吗?有什么问题?
-
这能回答你的问题吗? $.getJSON not working
标签: javascript jquery json api weather-api