I have my json value coming from java, as
var obj = "[{"id":"58","str":"sd <p/> Comment By Smith John on 2012-10-30"},{"id":"58","str":"sd <p/> Comment By Smith John on 2012-10-30"},{"id":"58","str":"sd <p/> Comment By Smith John on 2012-10-30"},{"id":"58","str":"sd <p/> Comment By Smith John on 2012-10-30"},{"id":"58","str":"sd <p/> Comment By Smith John on 2012-10-30"},{"id":"58","str":"sd <p/> Comment By Smith John on 2012-10-30"},{"id":"58","str":"sd <p/> Comment By Smith John on 2012-10-30"},{"id":"58","str":"sd <p/> Comment By Smith John on 2012-10-30"}] ".
I want to parse using jquery as $.parseJSON(obj);
I am getting error as undefined. I want to get the id value.
I included the jquery-ui.js and jquery.js.
I checked in the jsonlint and get it as valid json.
$.parseJSON()
because jQuery will parse the string for you and pass the resulting object (in this case an array) to the callback function you provide.