Jump to content

My game won't load json tilemap


Whack
 Share

Recommended Posts

 

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

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

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...