【发布时间】:2021-02-10 06:38:43
【问题描述】:
如果我问了很多问题,我很抱歉,但我需要帮助。 我使用了这个脚本,它工作正常,但在控制台中我有这个错误:{Uncaught (in promise) TypeError: Failed to fetch} 谁能告诉我我的错误在哪里。
fetch('/feeds/posts/default?alt=json')
.then(response => response.json())
.then(data => {
var authorPosts = data.feed.entry.filter(e => e.author[0].name.$t === "mark wael");
var len=authorPosts.length;
console.log(len);
$(".authorPostsCount").append(len);
});
------------------
<span class='authorPostsCount'/>
感谢您的帮助
【问题讨论】:
-
我认为this answer 可能对您有所帮助。
标签: javascript fetch blogger