Jquery 带有引导标记的下拉列表(typeahead.js)不';不行?
我需要将typeahead.js与bootstrap.taginput一起使用, 用于产品输入字段Jquery 带有引导标记的下拉列表(typeahead.js)不';不行?,jquery,ajax,typeahead.js,bootstrap-tags-input,Jquery,Ajax,Typeahead.js,Bootstrap Tags Input,我需要将typeahead.js与bootstrap.taginput一起使用, 用于产品输入字段 $('.product').tagsinput({ typeahead: { source: function (query, process) { return $.getJSON( '<?php echo site_url("ajax/get_products"); ?>', { query: query
$('.product').tagsinput({
typeahead: {
source: function (query, process) {
return $.getJSON(
'<?php echo site_url("ajax/get_products"); ?>',
{ query: query },
function (data) {
return process(newData);
});
alert(newData);
}
}
});
运气不好,下拉菜单不出现,输入标签也不起作用
我按以下顺序添加的文件
bootstrap tagsinput.csstypeahead.jquery.js
引导标记put.min.js
我是否需要额外的css或js文件,或者我是否有任何其他问题,如数据格式等。您能提供这样的示例吗?例如
{
"1":{"id":"1","value":"Banana"},
"2":{"id":"2","value":"Dell Laptop"},
"3":{"id":"3","value":"Rent A car Management System"}
}