2015-05-12 35 views
3

我试图与physi.js库()。我跟所有的步骤给出:“physi.js”导致错误:“脚本不能从原始访问'null'”

https://github.com/chandlerprall/Physijs/wiki/Basic-Setup

但是,我得到了错误:

Uncaught SecurityError: Failed to construct 'Worker': Script at 'file://172.16.159.200/js/physijs_worker.js' cannot be accessed from origin 'null'. 

我试图去更深,看到与线的问题:

this._worker = new Worker(Physijs.scripts.worker || 'physijs_worker.js'); 

是什么导致了这个问题?浏览器是谷歌浏览器。我检查过,文件“physijs_worker.js”出现在正确的位置。

+0

分享到:[本文](https://stackoverflow.com/q/21408510/465053),[这里](https://stackoverflow.com/ q/37718656/465053)和[这里](https://stackoverflow.com/q/6811398/465053)。 – RBT

回答

2

在Web服务器上部署您的网站。没有Web服务器,我得到相同的错误。