0

Say there is a directory:

/
  | - script.js
  | - fooDir
    | - index.html
    | - meta.json
  | - barDir
    | - index.html
    | - meta.json

index.html runs script.js.

Here, I want script.js to "read" the contents of meta.json, and parse it. Since the metadata here is static, I could include in index.html directly, but it's much easier to create the meta data directly since it is being copied over from another JSON source.

Is this possible? I.e. to "read" the contents of ./meta.json?

The entire website is hosted statically.

Alex Coleman
  • 505
  • 3
  • 9
  • I think the best way around this is to convert the json file to js. https://stackoverflow.com/a/30578719/7769344 – Tahlil Jun 12 '21 at 04:23

0 Answers0