Reputation: 1406
I have this JSON, that I need to use.
{"services":{"344":{"post":{"ID":344}},"345":{"post":{"ID":345}}}}
I need to get the value of services.344.post.ID which is 344. How can this be achieved?
Thank you in advance.
Upvotes: 0
Views: 18
Reputation: 59284
If
var obj = JSON.parse('{"services":{"344":{"post":{"ID":344}},"345":{"post":{"ID":345}}}}');
Then you want obj['services']['344']['post']['ID']
Upvotes: 1