loading...

re: How can I read a local JSON file in HTML/JavaScript? VIEW POST

TOP OF THREAD FULL DISCUSSION
re: What about other browsers? And how can I ensure, or detect whether a user toggled said specific CORS flag in their browser? If you could answer the...

So, I decided to quickly test it using GitHub pages. Instead of using console.log(data) I got the div and changed the text content:

$('#div_id').text(data.id);

and JSON being:

{
  "id": "Foo"
}

I've only tested it on my current browser (Firefox with CORS thingy off) and my s9+ using bromite (Chromium based) and it seems to be displaying the value of id without any issues.

code of conduct - report abuse