0

If I have a JSON file that contains a key, "text", and has an empty value how can I update the empty value?

I am using angularjs to make it interact with the user. I am also using $http.get to retrieve the json file. I am able to save the text to localstorage but I am having trouble sending the localstorage value into the JSON file. Overall I want the user to refresh the page and the text to still be there.

This is just a general overview of what I want to do which is why I am not providing code. All I want to do is figure out how, if possible, to update the JSON file so that next time it is refreshed and the $http.get is called again, the key has an updated value and it is displayed.

1 Answer 1

2

The basic step is to write a server side script (in perl/python/php etc) and then do an http post request from your AngularJS and your script updates the file in question. This is a good link to understand how to do it in python http://www.pythonschool.net/server-side-scripting/introduction-to-server-side-scripting/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.