jQuery UI autocomplete: how to send post data?

后端 未结 5 1994
伪装坚强ぢ
伪装坚强ぢ 2021-02-20 17:25

From jQuery UI site (veiw source):

$( \"#birds\" ).autocomplete({
    source: \"search.php\",
    minLength: 2,
    select: function( event, ui ) {
        log(          


        
5条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-20 18:06

    Actually, you can do this more simple with type: "post":

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

提交回复
热议问题