我的p5.js
和sketch.js
脚本都不会加载。什么是从node.js服务器加载脚本的正确src =属性
我index.html
由Node.js
装我想我在我的HTML标签<script>
滥用src
值。 我的p5.js
脚本已上升一级,并且名为P5
的文件夹中,并且我的sketch.js
文件位于与此index.html
文件相同的目录中的文件夹P5Scripts
中。
在Chrome控制台,我得到这个消息: Loading failed for the <script> with source “http://45.76.140.199:3000/P5/p5.js”.
和
Loading failed for the <script> with source “http://45.76.140.199:3000/P5Scripts/sketch.js”.
我可以看到我的src
属性是错误的,但什么是加载这些正确的方法脚本?
index.html:
<!doctype html>
<html>
<head>
<title>My Website</title>
</head>
<script src="../P5/p5.js"></script>
<script src="P5Scripts/sketch.js"></script>
<body>
</body>
</html>
我基本上希望Node.js最终在P5中触发事件,但现在我只想将p5加载到屏幕上:) –
从html中您将只使用普通的javascript。然后,您将使用前端的ajax处理您的触发器事件,并将所需的信息发送到后端。然后才是nodejs的时间。 –