- 已关闭。**此问题为not reproducible or was caused by typos。当前不接受答案。
这个问题是由打字错误或无法再重现的问题引起的。虽然类似的问题在这里可能是on-topic,但这个问题的解决方式不太可能帮助未来的读者。
昨天关门了。
Improve this question
我得到这个javascript代码的错误,这是一个函数,以获取单词的含义与免费字典API
async function fetchAPI(word){
const url = `https://api.dictionaryapi.dev/api/v2/entries/en/${word}`;
const result = await fetch(url).then(res=>res.json());
console.log(result);
}
我必须得到如下所示的JSON数据:
[
{
"word": "hello",
"phonetic": "həˈləʊ",
"phonetics": [
{
"text": "həˈləʊ",
"audio": "//ssl.gstatic.com/dictionary/static/sounds/20200429/hello--_gb_1.mp3"
},
{
"text": "hɛˈləʊ"
}
],
"origin": "early 19th century: variant of earlier hollo ; related to holla.",
"meanings": [
{
"partOfSpeech": "exclamation",
"definitions": .................
相反,我得到的输出为:
{
"title": "Something Went Wrong",
"message": "Sorry pal, something went wrong, and its not your fault.",
"resolution": "You can try the search again at later time or head to the web instead."
}
1条答案
按热度按时间eeq64g8w1#
我认为这不是你的错。如果你在浏览器中尝试这个url,你可以看到他们的服务器现在有问题。