net :: ERR_FAILED加载本地.json文件时?

我正在使用bodyworks和lottie加载自定义SVG动画,由于某种原因,它引发GET错误。该文件的路径是正确的,因为当我将其复制并粘贴到浏览器中时,它可以很好地加载,因此我不确定出什么问题了?

var animation = bodymovin.loadAnimation({
    container: document.getElementById("animationContainer"),// the dom element that will contain the animation
    renderer: 'svg',loop: true,autoplay: true,path: 'data.json' // the path to the animation json
});

该文件最初位于嵌套文件夹中,但我认为这可能是某些错误的原因,因此我将其移动了,但是仍然无法加载。任何帮助将不胜感激

> bodymovin.js:1300 GET file:///G:/My%20Drive/YetiTech/YetiTechNewSite/YetiTech/The%20Fresh%20Site%20of%20Bel%20Air/data.jsonnet::ERR_FAILED
iCMS 回答:net :: ERR_FAILED加载本地.json文件时?

尝试下载并安装Mamp Web服务器以创建本地Web服务器https://www.mamp.info/,然后将文件夹动画移至localhost文件夹内,然后直接在浏览器中将其打开,例如localhost / animation-example /

本文链接:https://www.f2er.com/1803962.html

大家都在问