I'm trying to parse my JSON code through jQuery but I stuck with this situation.
My JSON code :
var options =
"Group": { /* This will dynamically change depending on user input */
"Setting 1" : { /* This will dynamically change too depending on user input */
"id": "related_posts",
"name": "Related Posts",
"desc": "Show Related Posts",
"type": "checkbox",
"std": 0
},
"Setting 2": { /* Also this will dynamically change depending on user input */
"id": "breaking_news",
"name": "Breaking News",
"desc": "Hide Breaking News",
"type": "checkbox",
"std": 1
}
}
I tried this but it work only if it's constant :
options.Group["Setting 1"].id
In conclusion I want a method to get dynamic keys.
I forget to mention that I'm still learning jQuery so I don't have a lot of knowledge about it.