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)
返回:
但是表单仅返回noResultsText
值。