Jquery UI autocomplete ajax is not populating dropdown box

后端 未结 1 1278
鱼传尺愫
鱼传尺愫 2021-01-13 23:51

I need help with this, I can\'t see where is the problem.

When I set source for autocomplete in html file, it works fine, when I same source or database values print

相关标签:
1条回答
  • 2021-01-14 00:28

    The parameter response is actually a callback tthat you have to call - passing it your data - to display the result popup menu. Simply call it in the "success" callback:

    source: function(request, response) {
        $.ajax({
            ...
            success: function(data) {
                // pass your data to the response callback
                response(data);
            },
            error: function(message) {
                // pass an empty array to close the menu if it was initially opened
                response([]);
            }
        });
    },
    
    0 讨论(0)
提交回复
热议问题