I have a json like
var jsonObject = {
"key": [
{
"key1": "value1",
"info": "info"},
{
"key2": "value2",
"info": "info"}
]
};
I need to retrieve the key and value from this but dynamically, assuming that I don’t know the JSON since it will be generated from the web service..
If you need to process the JSON object in JavaScript, you’ll need a recursive function like this:
Replace the
console.logwith whatever you want to do to the data.