I’m trying to parse this json string and it’s not working. It’s giving me a syntax error in chromes javascript console and firebug. Any help would be greatly appreciate! Thanks much!
"{ "SUCCESS" : false, "DATA" : '', "ERRORS" : [ "duplicate item" ]}"
Uncaught SyntaxError: Unexpected token ILLEGAL
here’s my code:
var json = objResponse;
//var obj = JSON.parse(json); //this doesn't work either
var obj = jQuery.parseJSON(json);
alert(obj.SUCCESS);
Don’t mismatch your quotes or your quote types, for example:
Will parse just find. An additional note, single quotes are not valid for a JSON string.