1

Please note this application will never be running on a server system.

I am trying to read a local json file the code I am using is:

jQuery.getJSON('/Users/michael/jscrud/json/test.json')
  .done(function(data) {
 //do something here
}

I also need to be able to change this file adding meta data about the changes made. Any help would be great thanks. As I have spent 3 days trying to find the answer.

Sagarmichael
  • 1,624
  • 7
  • 24
  • 53

1 Answers1

2

Most browsers prohibit file requests from JavaScript, but they also generally have non-standard way to disable it for local debugging purposes (see, for example, solution for Chrome). However, absolutely no browser will allow you to change data, as it simply not how things regularly work online - you can't tell some server to "change file at this URL", so there's no support for such thing for file:// protocol either.

Community
  • 1
  • 1
Oleg V. Volkov
  • 21,719
  • 4
  • 44
  • 68