Answer the question
In order to leave comments, you need to log in
How to write form to .json file using JS?
There is a need to write data from an HTML form to a json file in a local file (located in the same folder) with the .json extension.
How to do it with JS? And that each new record would be made to the end of the file.
Answer the question
In order to leave comments, you need to log in
File API
Restrictions: Requires user permission. That is, it will not work quietly to write to a file.
No way. It is not possible to open a file for writing from browser JS. The very idea of doing something from a browser on a local computer is absurd - too big a hole for viruses.
If data storage is required on the client side, then use LocalStorage . Or write information to the server and transfer it from the server to JS by ajax request.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question