jQuery UI autocomplete select event not working with mouse click

前端 未结 9 844
星月不相逢
星月不相逢 2020-12-28 15:09

I have a list of links, and I have this search box #reportname. When the user types in the search box, autocomplete will show the text of the links in a list.



        
9条回答
  •  孤独总比滥情好
    2020-12-28 15:39

    After inspecting the code in the developer tools console, I noticed there were two list items added. I removed the pairing

  • from my response code and oh yeah, the links worked

    I also added this function as the click event:

     $("#main-search").result(function ()
        {
            $("#main-search").val("redirecting...."), window.location.href = $("#main-search").attr("href").match(/page=([0-9]+)/)[1];
        })
    

    This works and you can test it here: Search for the term dress -->

提交回复
热议问题