1

I am trying to load a local JSON file inside my javascript project but I am getting this error

Failed to load resource: Preflight response is not successful
XMLHttpRequest cannot load file:///Users/directory/directory/bla/bla. Preflight response is not successful`

I am parsing my JSON file using JQuery like this

    $.getJSON('sources/appInfo.json', function(json) {
        console.log(json);
    })

I heard that if I run my project on Firefox it will work. Indeed it did but I wan't to make sure it will work on most if not all browsers. I also tried uploading the file onto a server and that still did not work.

I've seen similar problems online but most are external JSON files that they are requesting. This is just a local file I want to parse. Any ideas on how I can go about this problem?

Thanks.

Rory McCrossan
  • 331,213
  • 40
  • 305
  • 339
John Brown
  • 11
  • 1

0 Answers0