I have a json file in localstorage and i have assigned that json to a variable with javascript so that i can access that with php. Now i want to append the values of that json file in my localstorage to the json file in my webserver.
this is the sample javascript code how i added the localstorage json to variable
var lstore = ('data:application/json;charset=utf-8,' + encodeURIComponent(localStorage.regions));
now when i run window.open(lstore);
in javascript program, i am able to see the complete json array in the browser window.
sample json array looks like this
[{
"start":6,
"end":8.2,
"data":{
"note":"ex1"
}},
{
"start":8.6,
"end":12.2,
"data":{
"note":"rtt save"
}},
{
"start":12.8,
"end":16.2,
"data":{
"note": "rtl rss"
}},
what i want to do is call a php script from javascript and then append the values of my localstorage json data to the json file on my webserver. But also i want to check if the same "start" and "end" values is already present in the json file in my server then just update the "note" value orelse add the new "start", "end" and "data" value.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…