Possible Duplicate:
How to parse JSON in JavaScript
I have this JSON string:
[{"title": "Title1"}, {"title": "Title2"}]
How can I parse it, so that I can get each title?
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.
Note that
JSON.parseisn’t available in all browsers; use JSON 3 where necessary.The same goes for ES5
Array#forEach, of course. This is just an example.If you’re using jQuery, you could use
$.eachto iterate over the array instead. jQuery has ajQuery.parseJSONmethod, too.