gpt4 book ai didi

javascript - 未捕获的语法错误 : Unexpected end of input for particles. js

转载 作者:行者123 更新时间:2023-12-02 21:24:36 24 4
gpt4 key购买 nike

在使用 keywords.js 时,我收到 Uncaught SyntaxError: Unexpected end of input on line 36。
代码:https://jsfiddle.net/30qtvprj/代码的主要问题部分(触发错误的地方):

particlesJS("particles-js", resp);
var count_particles, stats, update;
stats = new Stats();
stats.setMode(0);
stats.domElement.style.position = "absolute";
stats.domElement.style.left = "0px";
stats.domElement.style.top = "0px";
document.body.appendChild(stats.domElement);
count_particles = document.querySelector(".js-count-particles");
update = function() {
stats.begin();
stats.end();
if (window.pJSDom[0].pJS.particles && window.pJSDom[0].pJS.particles.array) {
count_particles.innerText = window.pJSDom[0].pJS.particles.array.length;
}
requestAnimationFrame(update);
};
requestAnimationFrame(update);

最佳答案

我认为你的 jsonstuffs 需要是这样的对象:

var jsonstuffs = {

setData: function (key, obj) {
var values = JSON.stringify(obj);
localStorage.setItem(key, values);
},

getData: function (key) {
if (localStorage.getItem(key) != null) {
return JSON.parse(localStorage.getItem(key));
} else {
return false;
}
},

updateDate: function (key, newData) {
if (localStorage.getItem(key) != null) {
var oldData = JSON.parse(localStorage.getItem(key));
for (keyObj in newData) {
oldData[keyObj] = newData[keyObj];
}
var values = JSON.stringify(oldData);
localStorage.setItem(key, values);
} else {
return false;
}
}
}

关于javascript - 未捕获的语法错误 : Unexpected end of input for particles. js,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60767517/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com