usable application #1
@ -30,6 +30,8 @@ function displayResponse(response) {
|
||||
|
||||
function main() {
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
const searchElement = document.getElementById("query");
|
||||
searchElement.value = params.get("query") || "";
|
||||
return fetch(`/api/search?${params.toString()}`)
|
||||
.then(v => v.json())
|
||||
.then(displayResponse);
|
||||
|
Loading…
Reference in New Issue
Block a user