Demo Site

Thursday, March 08, 2012

Ajax requests in Chrome when loading local files

This always annoyed me trying to find, so here it is, if you're trying to load up an html page with some javascript that needs to make ajax requests, but you're doing it without running a webserver, then Chrome will block those requests unless you start Chrome with these startup flags:

--args --allow-file-access-from-files --disable-web-security
On Ubuntu this then looks like:


$ /opt/google/chrome/google-chrome --args --allow-file-access-from-files --disable-web-security
Then you look at page like:

file:///home/Documents/Workspaces/workspace-sts-2.7.0.RELEASE/myapp/src/test/webapp-test/scripts/panels/gwindow-test.html

and ajax requests will work-


No comments:

Labels

Labels

Labels