Note that there are some explanatory texts on larger screens.

plurals
  1. POSaving JSON to local disk
    text
    copied!<p>I have some json data in a variable using the .ajax method provided by jquery. During processing i am modifying some part of it. Now I wish to save it back so that a refresh will load the changed values. I am using the .ajax() with 'post' as type : </p> <pre><code>$.ajax({ type: 'POST', url: "Scripts/"+fileName, async: false, data: JSON.stringify(myData), dataType: "json", success: function(data) { alert('hi...'); }, error: function () { alert('error...'); }}); </code></pre> <p>My json data has arrays etc :</p> <pre><code>{"workbook":{"excelname":"D:\/JavaProject\/SpreadsheetScanningFromRepository\/testing\/Test Data - Relationship\/multilevelLabels.xls","sheet":{"name":"Sheet1","structures":{"structure":{"StructureComment":null,"orientation":"Labels are in Rows","CompleteData":[{"label":"Company name","data":[["Bathni",{"datatype":"String Data"}],["Bathni",{"datatype":"String Data"}],["Bathni",{"datatype":"String Data"}],["Bathni",{"datatype":"String Data"}],["BBM",{"datatype":"String Data"}],["BBM",{"datatype":"String Data"}],["BBM",{"datatype":"String Data"}],["Finsys",{"datatype":"String Data"}],["Finsys",{"datatype":"String Data"}],["Avaya",{"datatype":"String Data"}]]}... </code></pre> <p>The call shown above returns a success and prints hi but no change in the file!! async is false so it should have made the change immediately. The url given is the same one i use to read json data from the local filesystem so that should not have any issues.</p> <p>Please give me any hints/ suggestions for making this work!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload