$.ajax({
url: newUrl,
type: "GET",
dataType: 'json',
crossDomain: "true",
success: function (result) {
if (result.type == false) {
alert("Error occured:" + result.data);
return false;
}
//FIX Uncaught SyntaxError: Unexpected token u in JSON at position 0
$.each(result.data, function(index, obj) {
console.log(obj.description);
$("#description").append("<div class='panel-heading'>" + obj.description + "</div>")
});
}
});
文件Json位于&#34; JSON.stringify&#34;
[
5,
"Mac Book Air Core i5 C/ disco SSD 120 GB",
500,
"Vendo Mac Book Air 11 \" em perfeito estado de aparência e funcionamento , com capa de protecção ",
1000,
0
]
不要在console.log(obj.description);