paper.js 导致参考错误,拼写错误已被纠正
我一直在使用JavaScript和PaperScript来制定测试程序并遇到一个有趣的问题。我收到了此错误消息:未介绍的ReferenceError:veiw未定义
,我意识到我的视图错误并在代码中对其进行了更正。但是由于某种原因,错误消息坚持了下来,我已经重新启动了计算机,并使用CTRL+F在文件中搜索“ VEIW”,但错误消息仍然存在。 这是我当前的代码:
console.log("Hi");
view.onFrame = function(event){
project.importSVG('.../mario.svg');
};
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script src="./scripts/paper-full.js"></script>
<script type="text/paperscript" src="./scripts/script.js" canvas="myCanvas"></script>
</head>
<body>
<canvas id="myCanvas" width="200" height="100"
style="border:1px solid #d3d3d3;">
</canvas>
</body>
</html>
我不知道这是否相关,但是每次加载网页称为vm
后,似乎都会由Paper JS生成的文件,然后是一个数字。
document.__paperscript__ = function(paper,project,setup,clear,paper) {var module = { exports: {} }; veiw.onFrame = function(event){
project.importSVG('.../mario.svg');
};
//paper.setup(htmlCanvas);
//paper.project.clear();
//paper.project.importSVG('mario.svg');
return module.exports;
}
如您所见,此后从源文件中删除的类型和一些注释仍在这里。但是我保存了文件并重新加载了页面(使用url:http:// localhost:8000/html.html
,使用Python的http.server运行服务器)。 我对造成这种情况的原因毫无意义,我找不到对我任何文件中任何地方的veiw
的引用。请帮我。我一周前的错字困扰着我。它不会消失。
I've been using javascript and paperscript to make a test program and have an interesting problem. I got this error message: Uncaught ReferenceError: veiw is not defined
, I realised that I had mis-spelled view and corrected it in my code. But for some reason the error message persised, I've restarted my computer and used ctrl+f to search for 'veiw' in my files, but still the error message persists.
Here is my current code:
console.log("Hi");
view.onFrame = function(event){
project.importSVG('.../mario.svg');
};
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script src="./scripts/paper-full.js"></script>
<script type="text/paperscript" src="./scripts/script.js" canvas="myCanvas"></script>
</head>
<body>
<canvas id="myCanvas" width="200" height="100"
style="border:1px solid #d3d3d3;">
</canvas>
</body>
</html>
And I don't know if this is relevant but there seems to be a file generated by paper js each time the webpage is loaded called VM
followed by a number.
document.__paperscript__ = function(paper,project,setup,clear,paper) {var module = { exports: {} }; veiw.onFrame = function(event){
project.importSVG('.../mario.svg');
};
//paper.setup(htmlCanvas);
//paper.project.clear();
//paper.project.importSVG('mario.svg');
return module.exports;
}
As you can see both the type and a few comments that have since been removed from the source file are still here. But I have saved the file and reloaded the page (using the url:http://localhost:8000/html.html
with python's http.server running the server).
I am clueless as to what is causing this, and I can't find a reference to veiw
anywhere in any of my files. Please help me. I'm being haunted by a typo I made a week ago. It won't go away.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现了。我要发布此信息,所以其他人没有同样的问题。之所以发生这种情况,是因为我使用保存的网页的Chrome加载速度更快,因此当您更改代码时...它识别它是同一页面并且不会加载新内容。可以通过转到您的Chrome历史记录
Chrome:// history/
并单击“清除浏览数据”,然后单击“高级”选择“缓存的图像和文件”,然后取消选择其他所有内容,然后只需设置,就可以解决此问题。顶部的时间使您不会删除太多不想的东西。笔记:
执行此操作不会删除任何重要数据,也不选择“时间范围:所有时间”的唯一原因是,网页加载速度更快,这是该数据首先存储的原因。
I figured it out. And I'm posting this so other people don't have the same problem. This occurs because chrome, which I am using saved webpages so they load faster, so when you change your code... it recognises that it is the same page and doesn't load the new stuff. This can be fixed by going to your chrome history
chrome://history/
and clicking 'clear browsing data' then click 'advanced' select 'cached images and files' and unselect everything else, then just set the time at the top so that you don't delete too many things you don't want to.NOTE:
Doing this wont delete any important data, the only reason not to select 'Time range: ALL TIME' is so that webpages load faster, which is the reason this data is stored in the first place.