0

I'm trying to make a website that reads a JSON file from my computer. Instead of displaying the file's information, I only get [Object object].

const response = await fetch('./AppData/LocalLow/WilhelmsenStudios/ReEntry/Export/Apollo/outputLGC.json');
let program = await response.json();

document.getElementById('program').innerHTML = program;

This is what I tried to use to solve the problem.

I am not using any Javascript frameworks.

Does anyone know how to fix this?

doublesharp
  • 26,888
  • 6
  • 52
  • 73
Swap
  • 1

1 Answers1

-1

Try this:

document.getElementById('program').innerHTML = JSON.stringify(program);
Jason Byrne
  • 1,579
  • 9
  • 19