jQuery(1.11)自动完成-如何查看从源返回的数据?

jQuery(1.11)自动完成-如何查看从源返回的数据?,jquery,jquery-ui,autocomplete,jquery-autocomplete,Jquery,Jquery Ui,Autocomplete,Jquery Autocomplete,我想在autocomplete:source“get”请求完成后查看autocomplete拥有的数据 我的源是字符串:“/jsonplaylist.json”。通过查看Firebug控制台,我可以看到Get请求响应: ["01-List","02-List","03-List","04-List","05-List","06-List","07-List","08-List","08-List","09-List","10-List","playlist01 - updated","playl

我想在autocomplete:source“get”请求完成后查看autocomplete拥有的数据

我的源是字符串:“/jsonplaylist.json”。通过查看Firebug控制台,我可以看到Get请求响应:

["01-List","02-List","03-List","04-List","05-List","06-List","07-List","08-List","08-List","09-List","10-List","playlist01 - updated","playlist02","playlist03"]
但autocomplete有哪些数据?我相信autocomplete创建了一个带有“标签”和“值”的新数据结构。是否仍然可以看到整个数据结构

“我的自动完成”当前看起来如下所示:

$( "#birds" ).autocomplete({
  source: "/jsonplaylist.json",
  minLength: 1,
  select: function( event, ui ) {
    console.log( ui.item ? "Selected: " + ui.item.value : "Nothing selected, input was " + this.value );
    return false;
  }
 });

我正在Rails 4应用程序中使用它,它工作正常。我想在“get”请求的值中添加一个“id”,当我这样做时,一切都停止工作(我的get响应是一个数组数组),即使我添加了一个_renderItem——我确信问题在于数据,但我不知道如何查看autocomplete正在使用的数据。

明白了。我误解了自动完成响应事件

搜索完成后,在显示菜单之前触发

$( "#birds" ).autocomplete({
  source: "/jsonplaylist.json",
  minLength: 0,
  select: function( event, ui ) {
    console.log(event);
    document.getElementById("birds").value = ui.item.value;
    document.getElementById("birdsID").value = ui.item.id;
    return false;
  },
  response: function(event, ui) { console.log(ui); }
});  // this ends the .data(ui-autocomplete)