Can anybody suggest a way to iterate the json array of format using jquery in javascript.
{"0",{"id":"10", "class": "child-of-9"},"1",{"id":"11", "class": "child-of-10"}}
i need to get the value of each class.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There is no point have an object where the keys are numbers. This is effectively how an array works with it’s indexes. What you have there is an object, not an array.
Turn this:
Into this:
And you have an array of objects. This can be iterated with a simple for loop, and accessed by index.