Paper.js外部文件将不会加载 [英] Paper.js external file will not load

查看:66
本文介绍了Paper.js外部文件将不会加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是试图进入paper.js.内联代码后,它们可以正常工作.但是,当我将它们移动到外部文件并将其保存到那里时,错误开始弹出:(任何人都可以找出我做错了什么吗?错误屏幕截图已附上

I am just trying to get into paper.js. Code works fine when they're inlined. But when I move them to an external file and src it there, errors starts to pop up :( Can anyone figure out what I did wrong? Error screenshot is attached

非常感谢!

错误屏幕截图

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>Paper.js Test</title>
		<script type="text/javascript" src="bower_components/paper/dist/paper-full.min.js"></script>
		<script type="text/paperscript" src="test.js" canvas="myCanvas"></script>
	</head>
	<body>
		<canvas id="myCanvas" resize="true"></canvas>
	</body>
</html>

推荐答案

在您的屏幕截图中,这是CORS错误.

From your screenshot, it is CORS ERROR.

您可以修复CORS ERROR,以使用 https://www.thepolyglotdeveloper.com/2014/08/bypass-cors-errors-testing-apis-locally/

You can fix CORS ERROR to test locally with https://www.thepolyglotdeveloper.com/2014/08/bypass-cors-errors-testing-apis-locally/

这篇关于Paper.js外部文件将不会加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆