求教打包web不能在谷歌和safari打开,可以在火狐打开问题

如题,mac下运行cocos compile -p web -m release后,打包成功。

XXX:Game XXX$ cocos compile -p web -m release
Running command: compile
Building mode: release
running: ‘/Users/XXX/Documents/apache-ant-1.9.4/bin/ant -f /Users/XXX/Documents/WorkSpace/cocos2d-js/Game/publish/html5/build.xml’

Buildfile: /Users/XXX/Documents/WorkSpace/cocos2d-js/Game/publish/html5/build.xml

compile:
Compiling 293 file(s) with 42 extern(s)
0 error(s), 0 warning(s)

BUILD SUCCESSFUL
Total time: 16 seconds

在火狐浏览器可正常打开,但是在谷歌和safari上不能打开,打开后是黑屏,错误提示如下
谷歌
XMLHttpRequest cannot load file:///Users/XXX/Documents/html5/project.json. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.game.min.js:17 cc.loader._loadTxtSyncgame.min.js:50 cc.game._initConfiggame.min.js:53 (anonymous function)
game.min.js:15 Uncaught TypeError: Cannot read property ‘style’ of nullgame.min.js:15 cc.loader._loadJsImggame.min.js:13 cc.loader.loadJsWithImggame.min.js:52 cc.game.preparegame.min.js:48 cgame.min.js:49 cc.game.rungame.min.js:2893 (anonymous function)

safari
TypeError: null is not an object (evaluating ‘a.style’)
_loadJsImg (game.min.js, line 15)
loadJsWithImg (game.min.js, line 13)
prepare (game.min.js, line 52)
c (game.min.js, line 48)
run (game.min.js, line 49)
global code (game.min.js, line 2893)

求大神指教,是什么地方出的错。cocos2d-js版本使用的是官网的v3.2

谷歌浏览器之前是打开本地html页面,访问跨域,造成的第一条的错误。在启动项加上–allow-file-access-from-files不会再报第一条错。
但是还是有错误提示,求教大神们是怎么回事
Uncaught TypeError: Cannot read property ‘style’ of null

好吧,问题解决了。是打开方式不对
把打包好的文件在服务器上部署好,通过服务器IP进行访问,所有的问题就都没有了。本地打开时因为要读取project.json文件,会造成跨域访问的错误。基础功夫要扎好喽!

我遇到了相同的问题,楼主你的问题解决了么?怎么解决的?
Uncaught TypeError: Cannot read property ‘style’ of null
_loadJsImg (game.min.js, line 15)
loadJsWithImg (game.min.js, line 13)
prepare (game.min.js, line 52)
c (game.min.js, line 48)
run (game.min.js, line 49)
global code (game.min.js, line 2893)

你这个跨域了,firefox是有对应处理的

现在问题是,把所有文件都放外网服务器上,在手机微信上都打不开啊,黑屏

在控制器提示的错误信息如下 :

你外网是用windows系统么?

是的,Windows Server 2003

额,我是说的你们服务器

我自己本地测试用的的服务器是win7系统WampServer
外网服务器上的就是Windows Server 2003 ,iis

那个好像不行,前几天群里也有人问了,他们把服务器改成linux的就可以了

是不是服务器端也要安装cocos-js环境?