forked from adipai/PopcornPicks
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updates to user review page. still not working
- Loading branch information
1 parent
f8f94fd
commit 2338757
Showing
2 changed files
with
40 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
$(document).ready(function () { | ||
|
||
var selectedMovie = ''; // Variable to store the selected movie | ||
|
||
$(function () { | ||
$("#searchBox").autocomplete({ | ||
source: function (request, response) { | ||
$.ajax({ | ||
type: "POST", | ||
url: "http://localhost:5000/search", | ||
dataType: "json", | ||
cache: false, | ||
data: { | ||
q: request.term, | ||
}, | ||
success: function (data) { | ||
response(data); | ||
}, | ||
error: function (jqXHR, textStatus, errorThrown) { | ||
console.log(textStatus + " " + errorThrown); | ||
}, | ||
}); | ||
}, | ||
select: function (event, ui) { | ||
// Clear the previous selection | ||
$("#selectedMovies").empty(); | ||
selectedMovie = ui.item.value; | ||
// Append the new selection | ||
var li = $("<li class='list-group-item'/>").text(selectedMovie); | ||
$("#selectedMovies").append(li); | ||
$("#searchBox").val(""); | ||
return false; | ||
}, | ||
minLength: 1, | ||
}); | ||
}); | ||
|
||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters