Jquery自动完成::清除缓存
我对两个字段使用jqueryautocomplete,Country和state。 我想要根据国家价值列出的州列表,我也得到了这个 我的问题是,国家自动完成也显示了以前国家搜索的结果。我知道这是因为jquery缓存了结果 请有人指导我如何解决这个问题 我的代码在下面Jquery自动完成::清除缓存,jquery,autocomplete,Jquery,Autocomplete,我对两个字段使用jqueryautocomplete,Country和state。 我想要根据国家价值列出的州列表,我也得到了这个 我的问题是,国家自动完成也显示了以前国家搜索的结果。我知道这是因为jquery缓存了结果 请有人指导我如何解决这个问题 我的代码在下面 $('#khk_adressen_LieferLand').autocomplete("/countries/auto_complete_for_countries_list",{ flushCache: function() {
$('#khk_adressen_LieferLand').autocomplete("/countries/auto_complete_for_countries_list",{
flushCache: function() {
return this.trigger("flushCache");
}
});
$('#khk_adressen_LieferPLZ').autocomplete("/postals/auto_complete_for_postals_list", {
flushCache: function() {
return this.trigger("flushCache");
},
extraParams: {
country_name: function() { return $("#khk_adressen_LieferLand").val(); }
}
});
提前完成任务这应该可以:
$("#country_id").result(function()
{
$("#state_id").flushCache();
});
在他们选择国家/地区后,它将清除缓存。您可以通过这种方式执行此操作。您可以设置所有设置…尝试
$("#setcommonelement_ElementName").autocomplete(data, {
minChars: 0,
width: 262,
matchContains: "word",
scrollHeight: 220,
cacheLength: 0
});
$(“#元素”).unautocomplete()
$(“#元素”).autocomplete(newData) 你能把你的密码寄出去吗。