Answer the question
In order to leave comments, you need to log in
What game JavaScript frameworks allow you to include resource files without a call to the server?
Hello. I'm looking for a framework for game development in JS. But the same problem arises during development: the browser does not allow the code to open and generally work with files in the local file system.
Let's say an example with the Phaser.js framework or Quintus :
Uncaught NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'file:///C:/racemath/data/sprites.json'.
Answer the question
In order to leave comments, you need to log in
XMLHttpRequest - http protocol, you have file://
In chrome, there is a flag to allow work using the file://
protocol --allow-file-access-from-files
Running with this flag will allow XMLHttpRequest to work locally.
- are there any frameworks that allow you to connect resources from files
?
There is one more feature, not always, but changing the creation of XMLHttpRequest from asynchronous to synchronous helps. (and this is also a recipe for smartphones, because there are no flags there)
If none of the above helps, run applications from a local server to develop an application, file:// will change to http:// and it will be ok.
In a mobile application, you can also run the server as a host, but I think there will not be such problems there to bother like that.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question