提取网址时遇到问题

时间:2019-07-26 12:23:05

标签: jquery

我一直在使用fetch在jQuery代码中使用API​​。我有这个URL https://api.adorable.io/avatars/list。我似乎没有任何反应。

我尝试使用Fetch方法,Get方法,但我可以得到任何响应。

const url = "https://api.adorable.io/avatars/listfetch;"

fetch(url).then(response => response.json()).then(data => {
  console.log(data)
})


$.get(url, function(response) {
  console.log(response)
})
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

我期待像对象一样的响应。

0 个答案:

没有答案
相关问题