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.
JavaScript strings containing
"characters must be either delimited by'character or have the"escaped as\".With your current code you should have errors trying to parse the JS that attempts to instantiate
objbefore it complains thatobjisundefined.