Answer the question
In order to leave comments, you need to log in
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
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)
I think JSON.parse() and JSON.stringify() are what you need.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question