JSON parse unexpected character
I see plenty of people run into this but their situations seem different. What is the problem in my case?
err: JSON.parse: unexpected character at line 1 column 2 of the JSON data
If jsonlint.com says it is ok, why does jQuery feel otherwise?
-
$(document).ready(function() {
try {
//alert('Here we go....');
window.jsondata = [{"label_no":"205","label_name":"20th Century Fox Records"}];
// https://jsonlint.com/ says Valid JSON
alert('window.jsondata length = ' + window.jsondata.length);
alert('1st row = ' + window.jsondata[0]);
var json = $.parseJSON(window.jsondata[0]);
alert('json length = ' + json.length);
}
catch (err) {
alert('err: ' + err.message); // err: JSON.parse: unexpected character at line 1 column 2 of the JSON data
}
});