你好,我正在使用typeahead jQuery库。在键盘上调用键头功能
我想在keyup中运行该函数,但它现在正在工作。
jQuery代码:
$.typeahead({
input: '.js-typeahead-car_v1',
minLength: 1,
maxItem: 0,
order: "asc",
hint: true,
source: {
searchkey: {
url: {
type: "POST",
url: "/search",
data: {
myKey: "muvalue"
}
}
}
},
callback: {
onClick: function (node, a, item, event) {
$("#topsearchbtn").trigger("click");
},
}
});
HTML:
<input type="text" name="term" class="form-control input-sm js-typeahead-car_v1"
maxlength="64" placeholder="Search Entire store here..." id="tags" autocomplete='off' />
我怎么能说上KEYUP $.typeahead({})
?
现在它不是每次都发送第一次请求的请求。
谢谢,但相同的搜索建议不来了。 –
这个函数被触发,我对此毫无疑问。在你的情况下,也许你在typeahead方法中传递的对象是错误的。 –
@DeepParekh你可以尝试使用typeahead函数中最少量的参数来确保事情正确。 –