title: Edit and save the json file data on the disk using Jquery Javascript
body: <p>I want to edit and write the data into the file which is on the disk and I want to save changes back to the same file using jquery. For this i have a button and textarea where I have edited the data and get the data before editing from json file as  html5 :</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function saveFile(data){
      
      $.getJSON("../custom_scripts/sub.json", function(data){
        
           var updatedData = $("#result").val();
           $("sub.json").replaceWith(updatedData);
          
      });
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>  &lt;form class="fileForm"&gt;
                  &lt;input type="file" value="Choose file" onchange="onFileSelected(event)"&gt;
                  &lt;br&gt;&lt;br&gt;
                  &lt;textarea id="result" rows="20" cols="100"&gt;&lt;/textarea&gt;
                  &lt;button type="button" id="savable" class="btn btn-default" title="Save Changes" onclick="saveFile();"&gt; Save&lt;/button&gt;
  &lt;/form&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>After selecting the file the data gets edited and the additional data which I have entered is the updatedData but it </p>