I get a string with the following output from json_encode
:
["images\/zara\/shoes\/thumbnail",
"images\/hermes\/shoes\/thumbnail",
"images\/hermes\/shoes\/thumbnail"]
I attempt to parse it with the below code, but it gives me an error:
var listofshoes = JSON.parse(data);
for (var i in listofshoes) {
$('#pgwrapid').append( $("<p>").text(listofshoes[i]));
}
ERROR: JSON.parse: unexpected character [Break On This Error] return window.JSON.parse( data );`
How do I prevent this?