Mil*_*les 5 html javascript processing.js
我想对我刚刚移植到processing.js的草图进行测试.当我加载网页时,我从Chrome中的javascript控制台收到以下错误:
XMLHttpRequest无法加载file:///Users/aoeuaoeu/Desktop/projects/local%20site%20files/_/ee.pde.Access-Control-Allow-Origin不允许使用null.processing.js:27未捕获错误:NETWORK_ERR:XMLHttpRequest异常101
这是我正在加载的页面的来源:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Earnest Emporium</title>
<!--Contact: earnestemporium@gmail.com-->
<script src="processing.js"></script>
<canvas data-processing-sources="ee.pde"></canvas>
</head>
<body>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
ee.pde和processing.js与html文件在同一目录中,所以我不确定发生了什么.我还应该指出,我正在本地测试这个,当我上传到我的ftp服务器上加载页面时出现了不同的错误.(也许它是chrome?我得到一个黑盒子,一旦它上传到ftp服务器就不会出现在firefox上的chrome上.它在firefox本地工作正常)
/processing.js:17946Uncaught SyntaxError: Unexpected token <
Processing.Sketch.attach/processing.js:17946
Processing.Processing.executeSketch/processing.js:16209
Processing/processing.js:16237
init/processing.js:17991
window.addEventListener.i
Run Code Online (Sandbox Code Playgroud)
我刚注意到这一点:
file:///Users/aoeuaoeu/Desktop/projects/local%20site%20files/_/ee.pde.
你在桌面上运行吗?如果我没有记错的AJAX确实不是从您的桌面上运行,你需要一个本地Web服务器设置,并通过调用你的本地主机上运行它.
| 归档时间: |
|
| 查看次数: |
7004 次 |
| 最近记录: |