How to use remote source with jquery ui combobox?

前端 未结 3 1905
情话喂你
情话喂你 2020-12-19 16:58

There is combobox with autocomplete enabled. How to pass JSON data as source for this combobox?

Upd. I\'ve found partial answer here - it allows me

3条回答
  •  清歌不尽
    2020-12-19 17:45

    Example taken from the link you added in your question :

            $( "#birds" ).autocomplete({
                source: "search.php", // remote site
                minLength: 2,
                select: function( event, ui ) {
                    log( ui.item ?
                        "Selected: " + ui.item.value + " aka " + ui.item.id :
                        "Nothing selected, input was " + this.value );
                }
            });
    

提交回复
热议问题