Is there an option to enable Chrome or the Internet Explorer to load (via ajax-get) an JSON file from the local harddisk?
Firefox does so by default. Internet Explorer says 'premission denied' at the line
request.open(method, url, true);
Is there an option to enable Chrome or the Internet Explorer to load (via ajax-get) an JSON file from the local harddisk?
Firefox does so by default. Internet Explorer says 'premission denied' at the line
request.open(method, url, true);
There are no simple cleaner way you can do this, you have to do some server-side coding.
I suggest you node.js this is very handy for this type of IO operations.
It looks very difficult for first time but it is very handy.
Download and install nodejs.
create a simple project to handle this.
In the directory you want files to get (e.x. D:\myfiles), create one file server.js
, content of that js file would be following
var connect = require('connect'); var serveStatic = require('serve-static'); connect().use(serveStatic("./")).listen(105);
npm install connect
and npm install serve-static
(up to this, is one time process)node server.js
- That's all your server is ready and runninghttp://localhost:105/<file name>
and you can get any files within that directory.For chrome you can use following command line flags, taken from following question
As noted in that question you need to restart your all chrome browsers.
For internet explorer, trick is to use ActiveX version of the XMLHttpRequest object. See following link.