Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ms-access/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery自动完成::清除缓存_Jquery_Autocomplete - Fatal编程技术网

Jquery自动完成::清除缓存

Jquery自动完成::清除缓存,jquery,autocomplete,Jquery,Autocomplete,我对两个字段使用jqueryautocomplete,Country和state。 我想要根据国家价值列出的州列表,我也得到了这个 我的问题是,国家自动完成也显示了以前国家搜索的结果。我知道这是因为jquery缓存了结果 请有人指导我如何解决这个问题 我的代码在下面 $('#khk_adressen_LieferLand').autocomplete("/countries/auto_complete_for_countries_list",{ flushCache: function() {

我对两个字段使用jqueryautocomplete,Country和state。 我想要根据国家价值列出的州列表,我也得到了这个

我的问题是,国家自动完成也显示了以前国家搜索的结果。我知道这是因为jquery缓存了结果

请有人指导我如何解决这个问题

我的代码在下面

$('#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)

你能把你的密码寄出去吗。