tobbyd Posted March 18, 2015 Share Posted March 18, 2015 Testing my Pixi program on my local machine and everything works fine in firefox but in chrome I get: Image from origin 'file://' has been blocked from loading by Cross-Origin Resource Sharing policy: Received an invalid response. Origin 'null' is therefore not allowed access code -------------------------------------------------------------------function loadAssets(){ console.log(":: Loading assets ::"); var assetUrl = "assets"; var loader = new PIXI.AssetLoader([ assetUrl + "/shadow.png", assetUrl + "/byra_clean.png", assetUrl + "/dummy.png", assetUrl + "/wire.png", assetUrl + "/wire_flare.png", assetUrl + "/kogg.png" ]); loader.onComplete = onAssetsLoaded; loader.load(); How do I make it work in chrome? I already tested putting the image files on an external server and loading them by setting assetUrl="http://externalserver/assets"; but I get the same error. I have to make it work for every user entering the site with chrome as browser. Thanks! Quote Link to comment Share on other sites More sharing options...
pauser Posted March 20, 2015 Share Posted March 20, 2015 Its my first minute here but this is not a problem from pixi/phaser but chrome does not alow you to load data without beeing in the same domain/server. Install an http server localy and try it.It should look like localhost/yourgame or somthing. Try https://www.apachefriends.org/de/index.html if you are using windows and on linux/mac you can simply start an python http server. python -m SimpleHTTPServer 80. Regards Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.