jQuery UI autocomplete: how to send post data?

后端 未结 5 1876
伪装坚强ぢ
伪装坚强ぢ 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:08

    Try changing the source to be a method which uses $.post:

    $("#birds").autocomplete({
      source: function (request, response) {
        $.post("search.php", request, response);
      },
      ...
    

提交回复
热议问题