Update Tester.HTML

This commit is contained in:
Dangrainage 2024-01-27 21:15:28 +01:00 committed by GitHub
parent db80776cd6
commit 99158495d7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -22,7 +22,7 @@
alert('Please enter a movie name.'); alert('Please enter a movie name.');
return; return;
} }
fetch(`https://filmer.anorak01.top/api/search?search_query=${encodeURIComponent(movieName)}`) fetch(`https://filmer.anorak.top/api/search?search_query=${encodeURIComponent(movieName)}`)
.then(response => response.json()) .then(response => response.json())
.then(data => { .then(data => {
displayResults(data); displayResults(data);
@ -41,7 +41,7 @@
let resultList = document.createElement('ul'); let resultList = document.createElement('ul');
results.forEach(result => { results.forEach(result => {
let listItem = document.createElement('li'); let listItem = document.createElement('li');
listItem.textContent = result; listItem.textContent = `Title: ${result.title}, Year: ${result.year}`;
resultList.appendChild(listItem); resultList.appendChild(listItem);
}); });
searchResultsDiv.appendChild(resultList); searchResultsDiv.appendChild(resultList);