如何知道elem的价值arr
function a(num){
function ab(elem){
let num=6
return elem.length>num;
}
return ab;
}
let arr=['caterpillar','justin','openhome'];
console.log(arr.filter(a()));我想获取这个 url 的数据https://github.com/ProjectSakura/OTA/blob/10/changelog/changelog_beryllium.txt#L2
我正在尝试使用 fetch api 来获取数据,但出现了 cors 错误
这是我想做的
async function showmodal1() {
console.log("hello")
const data = await
fetch('https://github.com/ProjectSakura/OTA/blob/10/changelog/changelog_beryllium.txt');
console.log(data)
}
showmodal1();
有什么方法可以获取 github txt 文件的数据我试着在互联网上找到这个但是我找不到任何东西谢谢你提前的帮助
编辑:
Access to fetch at 'https://github.com/ProjectSakura/OTA/blob/10/changelog/changelog_beryllium.txt' from origin 'http://127.0.0.1:5500' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled. changelog.html:361
GET https://github.com/ProjectSakura/OTA/blob/10/changelog/changelog_beryllium.txt net::ERR_FAILED
showmodal1 @ changelog.html:361
(anonymous) @ changelog.html:365
dispatch @ jquery.min.js:3
r.handle @ jquery.min.js:3
changelog.html:364
Uncaught (in promise) TypeError: Failed to fetch
这是错误日志
汪汪一只猫
阿波罗的战车
慕码人2483693
九州编程
随时随地看视频慕课网APP
相关分类