parseJSON jQuery Autocomplet

时间:2018-09-19 15:01:24

标签: jquery arrays json autocomplete

我正在尝试显示来自我的AJAX请求的数组,但是出了点问题。有错误:

  

JSON.parse:JSON数据第1行第2列的意外字符

$.getJSON(domain +"/data", request, function( data, status, xhr ) {
  $.each(JSON.parse(data), function(name,url){
    console.log(name + ":" +url)
  })
});

数组

{
  "users": [
    { "name": "jay", "url": "http://example.com/jay/" },
    { "name": "cleo", "url": "http://example.com/cleo/" },
    { "name": "tom", "url": "http://example.com/tom/" },
  ]
}

0 个答案:

没有答案