来自ajax的值调用json不显示

时间:2017-06-29 12:25:59

标签: jquery json ajax

$.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);

中显示任何内容

0 个答案:

没有答案