title: Write to a local JSON file from the browser
body: <p>I'm trying to write to my local JSON file with javascript, I'm getting it from my HTML, changing it and want to write it back. I found how to read it from <a href="https://stackoverflow.com/questions/19706046/how-to-read-an-external-local-json-file-in-javascript">here</a> but didn't find how to write to it back to the json file.</p>
  <p>Note: I want to this without Node.js , 'fs' won't help..</p>
  <p>My code to get the JSON file:</p>
  <pre><code>&lt;script type=&quot;text/javascript&quot; src=&quot;data.json&gt;&lt;/script&gt;
  &lt;script type=&quot;text/javascript&quot; src=&quot;javascrip.js&quot;&gt;&lt;/script&gt;
  
  var mydata = JSON.parse(data);
  </code></pre>
  <p>Then I changed the value of the 'name', for example.</p>
  <pre><code>mydata[&quot;name&quot;] = &quot;NewName&quot;;
  </code></pre>
  <p>And then I want to send it back to the json file, update it.</p>
  <p>I didn't really find any code to do so.</p>