First I have to run the below code in Windows 7 from command prompt to avoid cors problem :
chrome.exe --disable-web-security -–allow-file-access-from-files
The main file is in:
file:///C:/my_demo/index.html
In the directory of C:/my_demo/json/ the following files are stored:
autocomplete.json:
{
“data”: [“Acura”,“Audi”,“BMW”,“Buick”,“Cadillac”,“Chevrolet”,“Chrysler”,“Citroen”,“Dodge”,“Eagle”,“Ferrari”,“Ford”,“General Motors”,“GMC”,“Honda”,“Hummer”,“Hyundai”,“Infiniti”,“Isuzu”,“Jaguar”,“Jeep”,“Kia”,“Lamborghini”,“Land Rover”,“Lexus”,“Lincoln”,“Lotus”,“Mazda”,“Mercedes-Benz”,“Mercury”,“Mitsubishi”,“Nissan”,“Oldsmobile”,“Peugeot”,“Pontiac”,“Porsche”,“Regal”,“Renault”,“Saab”,“Saturn”,“Seat”,“Skoda”,“Subaru”,“Suzuki”,“Toyota”,“Volkswagen”,“Volvo”]
}
load.json:
{
“data”: [
["", “Kia”, “Nissan”, “Toyota”, “Honda”],
[“2008”, 100, 11, 12, 13],
[“2009”, 20, 11, 14, 13],
[“2010”, 30, 15, 12, 13]
]
}
save.json:
{
“result”: “ok”
}
And finally the main code of the index.html file:
When I run the page (file:///C:/my_demo/index.html) and click on the load button, then all data come in the table from load.json. No issue.
But, when I change and try to save or Autosave is clicked, the files (autocomplete.json & save.json) are not updated, however the program confirming: “Data saved”
I checked the Console in Developer Tools, but no error cooming:
Please help me, what is wrong ?
Thank You !