2

Possible Duplicate:
How to parse JSON using NodeJS?

I am running a server. The code is run on the server with Node.js -- never run in a browser.

How can I load a JSON file ("data.json") into javascript code as a javascript object? Should I just use jQuery/AJAX to do this? Is there a simple way with plain js? Thanks in advance! BTW I searched for this on both Google and this website without any clear answers.

0

1 Answer 1

3

Have a look at this

Read the whole contents of the file, and then just parse it.
Have a look at this question.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.