jQuery Autocomplete using extraParams to pass additional GET variables

后端 未结 13 749
独厮守ぢ
独厮守ぢ 2021-01-31 17:23

I am referring specifically to the jQuery Autocomplete v1.1 plugin by Jörn Zaefferer [source: http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/] as there seems to

13条回答
  •  死守一世寂寞
    2021-01-31 17:46

    use a .each first, then you can use $(this) and set whatever you need into a variable. the resulting variable can be used in the autocomplete

    $(".autosuggest").each(function (index, object) {
        var autosuggestType = $(this).attr("autoSuggestType");
        $(this).autocomplete("url",
                {                    
                    extraParams: {
                        autoSuggestType: autosuggestType
                    },
    

提交回复
热议问题