title: Save form data into local json file using jquery
body: <p>I have a basic form with some input fields. I want to save the form data into a json file on submitting the form.
  The format of the saved data in the json file should be like this.</p>
  
  <pre><code>[
      {"title":"some text","description":"some text","info":"some text","username":"some name"},
      {"title":"some text","description":"some text","info":"some text","username":"some name"},
      {"title":"some text","description":"some text","info":"some text","username":"some name"}
  ]
  </code></pre>
  
  <p>I tried doing this by using this code, but no data is saved in my 'story.json file'</p>
  
  <pre><code>$('form').submit(function() {
      $.ajax({
         type: 'POST', 
         dataType: 'json', 
         url: 'story.json', 
         data: $(this).serialize(), 
         success: function(data) { 
             alert(data.message); 
         },
         failure: function (data) {
             alert('Please try again');
         }
      });
   });
  </code></pre>
  
  <p>I want to save this form data on my local file.
  Please help me to find the correct way of doing this. Thanks</p>