how to change jQuery autocomplete plugin default querystring key? (term to that i want)

后端 未结 3 911
攒了一身酷
攒了一身酷 2021-01-01 10:42

jQuery autocomplete plugin sent request like this

mysite.com/suggestion?term=Sadegh

is there any way to change term querystring key to anot

3条回答
  •  佛祖请我去吃肉
    2021-01-01 11:47

    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);
        }
    });
    

提交回复
热议问题