jQuery AutoComplete 依赖项缓存问题

发布于 2024-09-15 17:54:04 字数 172 浏览 1 评论 0原文

我正在使用 jQuery AutoComplete 插件根据先前字段中输入的“汽车”名称来预填充名为“模型”的字段。

但是,如果用户在“型号”文本框中键入“C”,然后更改制造商并再次在“型号”文本框中键入“C”,则会出现相同的型号。我相信这一定是自动完成插件的缓存问题。我该如何解决这个问题?

谢谢

I'm using the jQuery AutoComplete plugin to pre-fill a field called 'Model' depending on the name of a 'Car' entered in a previous field.

However, if the user types in 'C' in the 'Model' text box, and then changes the manufacturer and types 'C' in the Model text box again, the same models appear. I believe this must be a cache issue with the AutoComplete plugin. How can I get around this?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

豆芽 2024-09-22 17:54:04

该文档讨论了 .flushCache 方法。不过还没有尝试过...

编辑:

$(document).ready(function () {
    $('.autocomplete_make').keyup(function() {
        $(".autocomplete_model").flushCache();
    });
    $(".autocomplete_model").autocomplete("/AutoComplete/Model.ashx",
    {
        extraParams:
        {
            make: function () {
                return $(".autocomplete_make").val();
            }
        }
    });
});

The documentation talks about a .flushCache method. Haven't tried it though...

EDIT:

$(document).ready(function () {
    $('.autocomplete_make').keyup(function() {
        $(".autocomplete_model").flushCache();
    });
    $(".autocomplete_model").autocomplete("/AutoComplete/Model.ashx",
    {
        extraParams:
        {
            make: function () {
                return $(".autocomplete_make").val();
            }
        }
    });
});
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文