I have this input which I want autocomplete with the script bellow. The url returns a list of strings. When I type, the data are shown in console however the autocomplete window does not pop up.
What might be wrong?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
</head>
<body>
<input type="text" class="form-control my-input" name="from" id="from">
<script>
$(document).ready(function () {
$("#from").keyup(function (string) {
$.ajax({
type: "GET",
url: "http://127.0.0.1:5000/complete?station=" + $(this).val(),
success: function (data) {
$("#from").autocomplete({
source: data
});
console.log(data)
}
});
});
});
</script>
</body>
</html>
