javascript - Cross Origin Request Only Supported With HTTP with PreloadJS (CreateJS) -


i making game on createjs , while adding loadqueue load images, error:

xmlhttprequest cannot load file:///home/me/programming/assets/background.png. cross origin requests supported http. createjs-2013.12.12.min.js:15 

i searched problem, , know happens because it's supposed on server work. however, right i'm in testing want able test when offline (and don't have server).

i've looked @ proposed solutions this. i've tried running google chrome with

--allow-file-access-from-files 

and

--disable-web-security 

but neither work.

is there way run preloadjs without putting images on server? if not, think make createjs suite , html5 whole unattractive tool making games compared allow loading of local files. hope i'm wrong , that's not true.

as lanny proposed in comment, easier in long run "bite bullet" , use local http server, force things in way not intended (like chrome command-line arguments). there many ways in browser behaves differently when working local urls (file:// instead of http://), better have "realistic" environment right start.

guessing path in error message, looks running mac os x, think comes python 2.7 installed default, simple way run local http server without having install calling:

python -m simplehttpserver 

in terminal, in root folder of createjs project.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -