Crunchify Core Java and J2EE Tutorials and Tips How to write JSON object to File in Java?
Apart from that, you can't write a JSON to a file on the clientside due to security reasons. (Otherwise you have access to the filesystems of your website's users.). You would have to use a server-side language for this, and store the file on the server-side.
JSON can be written into local storage using the JSON.stringify to serialize a JS object. You cannot write to a JSON file using only JS.
AJAX Intro AJAX XMLHttp AJAX Request AJAX Response AJAX XML File AJAX PHP AJAX ASP
Its pretty simple to write a JSON object to a text file using the file system module.