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