U
U
unStaiL2014-10-03 19:50:11
JavaScript
unStaiL, 2014-10-03 19:50:11

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

2 answer(s)
S
Sergey, 2014-10-03
@unStaiL

File API
Restrictions: Requires user permission. That is, it will not work quietly to write to a file.

A
Andrey Ezhgurov, 2014-10-03
@eandr_67

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 question

Ask a Question

731 491 924 answers to any question