I can read/open it but don't know how to update the specific value in it.
My data.txt
is like
[
{"slot": "1", "name": "Bob"},
{"slot": "2", "name": "John"}
]
then i want to update it like query the database "UPDATE data.txt SET name='James' WHERE slot=2"
After update, I want data.txt
to be like
[
{"slot": "1", "name": "Bob"},
{"slot": "2", "name": "James"}
]
How can I do this with javascript, Ajax, Jquery