T
T
tallegor2022-02-18 12:47:38
JavaScript
tallegor, 2022-02-18 12:47:38

How to open json file if it is in project folder?

There is a json file in my project folder. I need to connect it to a page / to a script in order to subsequently parse data from there, tell me, please, how can this be done?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rag'n' Code Man, 2022-02-18
@iDmitriyWinX

I'm not sure if this will work in a non-Webpack/nodejs environment, but you can just import it directly in your script:
import * as data from "data.json"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question