处理 js / jquery / ajax - 无法加载草图
我正在尝试使用以下代码:
$('#clicker').click(function(){
var canvasRef = $('<canvas id="project_canvas"/>');
var p = Processing.loadSketchFromSources(canvasRef, '/anything.pde');
$('#loader').append(canvasRef);
});
使用 jquery / ajax 加载处理 js 草图,它正在做一些奇怪的事情 - 试图分解 /anything.pde 的所有字符并抛出此错误:
GET http://localhost:8888/a 404 (Not Found)
GET http://localhost:8888/n 404 (Not Found)
GET http://localhost:8888/n 404 (Not Found)
GET http://localhost:8888/y 404 (Not Found)
GET http://localhost:8888/t 404 (Not Found)
GET http://localhost:8888/h 404 (Not Found)
GET http://localhost:8888/i 404 (Not Found)
GET http://localhost:8888/g 404 (Not Found)
GET http://localhost:8888/p 404 (Not Found)
GET http://localhost:8888/d 404 (Not Found)
GET http://localhost:8888/e 404 (Not Found)
知道发生了什么吗?
I'm trying to use the following code:
$('#clicker').click(function(){
var canvasRef = $('<canvas id="project_canvas"/>');
var p = Processing.loadSketchFromSources(canvasRef, '/anything.pde');
$('#loader').append(canvasRef);
});
To load a processing-js sketch using jquery / ajax and it's doing something weird - trying to break up all the characters of /anything.pde throwing this error:
GET http://localhost:8888/a 404 (Not Found)
GET http://localhost:8888/n 404 (Not Found)
GET http://localhost:8888/n 404 (Not Found)
GET http://localhost:8888/y 404 (Not Found)
GET http://localhost:8888/t 404 (Not Found)
GET http://localhost:8888/h 404 (Not Found)
GET http://localhost:8888/i 404 (Not Found)
GET http://localhost:8888/g 404 (Not Found)
GET http://localhost:8888/p 404 (Not Found)
GET http://localhost:8888/d 404 (Not Found)
GET http://localhost:8888/e 404 (Not Found)
Any idea what's going on?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
应该作为数组传递:
顾名思义,loadSketchFromSources,Sources,您可以将多个源作为数组传递。
Should be passes as an array:
As the name says loadSketchFromSources, Sources, you can pass multiple source as an array.