gpt4 book ai didi

javascript - 当我们按下空格键时在 tokeninput 中发出

转载 作者:行者123 更新时间:2023-11-30 06:12:04 26 4
gpt4 key购买 nike

如果我点击空格键然后 tokeninput.js 使用空查询字符串点击 ajax,请帮忙做什么。

<div class="text-field">
<input type="text" id="tags" name="tag" />
</div>
$("#tags").tokenInput(baseUrl + 'tags-for-course', {
prePopulate: tags,
hintText: "Type in a search term",
searchDelay: 300,
minChars: 3,
preventDuplicates: true,
zindex: 9999,
theme: "facebook",
onResult: function(item) {
return item;
}
});

最佳答案

您可以使用 tokenInput 的“minChars”设置来设置“2”。所以像

{
prePopulate: tags,
hintText: "Type in a search term",
searchDelay: 300,
minChars: 2,
preventDuplicates: true,
zindex: 9999,
minChars: 2
theme: "facebook",
onResult: function (item) {
return item;

}
}

关于javascript - 当我们按下空格键时在 tokeninput 中发出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58305208/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com