I have the data.json file but I am not able to save data into the data.json file. I have products array
{
"products": [
{
"first": 0,
"last": "Ocean Blue Shirt",
"des": "Ocean blue cotton shirt with a narrow collar and buttons down the"
},
{
"id": 1,
"name": "orange",
"description": "Ocean blue cotton shirt with a narrow collar and buttons down"
}
]
}
The below is my jquery code.I am using jquery function $.getJSON()
$(document).ready(function(){
$.getJSON("data.json", function(data){
data.products.push({
first:'Mike',
last:'jule',
des:'1920-1932'
});
JSON.stringify(data);
});
});
My file is not updating when I tried to save data into external json file name data.json.