Tokeinput无法加载结果

时间:2018-09-12 16:55:50

标签: javascript jquery ajax jquery-tokeninput

jQuery TokenInput插件未加载结果。代码:

$('.titles').tokenInput("http://localhost/ajax.php", {
  tokenLimit: 10,
  minChars: 3,
  searchDelay: 500,
  queryParam: 'query',
  propertyToSearch: 'nome',
  resultsLimit: 10,
  noResultsText: 'Nada encontrado',
  searchingText: "Procurando...",
  hintText: "Buscar titular",
  method: 'GET',
  onResult: function(results) {
    console.log(results);
  }
});

如果我搜索“ Acme”,则ajax.php返回:

[{"id":16,"nome":"Acme"},{"id":17,"nome":"Acme2"},{"id":18,"nome":"Acme3"}]

然后console.log(results)返回:

console

但是表单仅返回noResultsText值。

0 个答案:

没有答案