如何更改jQuery的自动完成插件默认的查询字符串键? (术语,我想) [英] how to change jQuery autocomplete plugin default querystring key? (term to that i want)

查看:160
本文介绍了如何更改jQuery的自动完成插件默认的查询字符串键? (术语,我想)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

jQuery的自动完成插件像这样发送的请求

jQuery autocomplete plugin sent request like this

mysite.com/suggestion?term=Sadegh

有没有办法来改变长期的查询字符串键到另一个?我无法找到我提供此选项;)

is there any way to change term querystring key to another? i can't find option that provide this for me ;)

推荐答案

我假设你正在使用 jQuery的 UI 自动完成

I assume you're using jQuery UI AutoComplete

您需要提供一个回调为源,像这样的:

You need to provide a callback as the source, like this:

$(...).autocomplete({
    source: function(term, callback) {
        $.getJSON("url", { foo: term }, callback);
    }
});

这篇关于如何更改jQuery的自动完成插件默认的查询字符串键? (术语,我想)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆