Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(function() {
- $("#autocomplete").autocomplete({
- source: function (request, response) {
- $.getJSON("localhost:5000/autocomplete", {
- q: request.term, // in flask, "q" will be the argument to look for using request.args
- }, function (data) {
- response(data.matching_results); // matching_results from jsonify
- });
- },
- minLength: 2,
- select: function (event, ui) {
- console.log(ui.item.value); // not in your question, but might help later
- }
- });
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement