Whack Posted September 6, 2015 Share Posted September 6, 2015 XMLHttpRequest cannot load file:///C:/Users/Eddie/Desktop/Survive%20The%20Horde/client/assets/lobby.json. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource. I get this error in my console when I try to load a json file for a tilemap. And then it says next: Phaser.Loader - tilemap[Lobby]: error loading asset from URL assets/lobby.json Any help? Link to comment Share on other sites More sharing options...
lekzd Posted September 6, 2015 Share Posted September 6, 2015 Read about CORS (https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS) If you want to load some ajax request data, you must to load it from same domain, where you run script, or from server, that allows requests from your server. try to make you local server for it, or disable Chrome security settings (http://stackoverflow.com/questions/3102819/disable-same-origin-policy-in-chrome) Link to comment Share on other sites More sharing options...
Skeptron Posted September 7, 2015 Share Posted September 7, 2015 What's more, you should put your game into a web server, not just access it from within your documents. The restrictions are heavy on direct document access for security reasons : browsers won't let you do much. Link to comment Share on other sites More sharing options...
hulk Posted September 9, 2015 Share Posted September 9, 2015 if you haven't local server, you can use IE or Edge test you game Link to comment Share on other sites More sharing options...
Recommended Posts