【问题标题】:Paper.js giving error in chrome [duplicate]Paper.js 在 chrome 中给出错误 [重复]
【发布时间】:2026-01-28 01:30:01
【问题描述】:

可能重复:
XMLHttpRequest Origin null is not allowed Access-Control-Access-Allow for file:/// to file:/// (Serverless)

当我使用 paper.js 时,我在 Google chrome 中收到此错误。 即使我从我的 js 文件中删除了我的所有代码,它也会给出错误。 刚开始用paperjs,所以没有搞错

未捕获的错误:NETWORK_ERR:XMLHttpRequest 异常 101

在 demo.js 文件中有一些小代码后,又出现了一个错误: XMLHttpRequest 无法加载 file:///E:/​​Shruti/Remote%20Triggering/demo/js/demo.js。仅 HTTP 支持跨源请求。

【问题讨论】:

  • 您无法使用 XHR 加载本地文件

标签: javascript google-chrome paperjs


【解决方案1】:

如果你想离线工作,你应该在 chrome 中添加--allow-file-access-from-files 选项。

【讨论】: