P
P
proton-m2015-09-25 22:15:51
JavaScript
proton-m, 2015-09-25 22:15:51

Is it possible to change json with javascript?

I welcome everyone! Let's say I have a json file and a js file, can I somehow change the json file through the js file (change words for example)?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Andrey Dyrkov, 2015-09-25
@VIKINGVyksa

Most likely not, for security reasons, js crypts from the browser cannot change files. You can receive data on the client using an ajax request, but the .json file itself will be read by the server and given to the client for an ajax request. On the client, you can modify the received .json file data and save via the server. There is a workaround for this, but I do not recommend doing it at all)

V
Vladimir Martyanov, 2015-09-25
@vilgeforce

I think JSON.parse() and JSON.stringify() are what you need.

I
Ivan, 2015-09-26
@LiguidCool

You can if your js is nodejs. The browser in the database does not seem to know how, for reasons of sisurity.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question