gpt4 book ai didi

jquery - Twitter jQuery typeahead - 如何删除缓存

转载 作者:行者123 更新时间:2023-12-03 22:43:02 25 4
gpt4 key购买 nike

我做了一个这样的查询...第一次,它运行了过滤器...酷,并且它起作用了...

但是现在有更多的条目,并且它似乎耗尽了缓存。如何强制它停止使用缓存?

var countries = new Bloodhound({
datumTokenizer: function (d) { return Bloodhound.tokenizers.whitespace(d.name); },
queryTokenizer: Bloodhound.tokenizers.whitespace,
limit: 10,
prefetch: {
url: Url + '/Country/JsonList',
filter: function (list) {
return $.map(list, function (country) { return { name: country.Name }; });
}
}
});

countries.initialize();

$('.countries.typeahead').typeahead(null, {
displayKey: 'name',
source: countries.ttAdapter()
});

最佳答案

我认为这比接受的答案更好:

var countries = new Bloodhound({
datumTokenizer: function (d) { return Bloodhound.tokenizers.whitespace(d.name); },
queryTokenizer: Bloodhound.tokenizers.whitespace,
limit: 10,
prefetch: {
url: Url + '/Country/JsonList',
filter: function (list) {
return $.map(list, function (country) { return { name: country.Name }; });
},
cache: false //NEW!
}
});

countries.initialize();

$('.countries.typeahead').typeahead(null, {
displayKey: 'name',
source: countries.ttAdapter() //NOTE: .ttAdapter() is deprecated and will be removed in V1
});

关于jquery - Twitter jQuery typeahead - 如何删除缓存,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21998700/

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