Update Tester.HTML
This commit is contained in:
parent
e4d0ffdb1b
commit
04b924b867
1 changed files with 3 additions and 4 deletions
|
@ -40,14 +40,13 @@
|
||||||
} else {
|
} else {
|
||||||
let resultList = document.createElement('ul');
|
let resultList = document.createElement('ul');
|
||||||
results.forEach(result => {
|
results.forEach(result => {
|
||||||
console.log('Result:', result); // Log the result object
|
|
||||||
let listItem = document.createElement('li');
|
let listItem = document.createElement('li');
|
||||||
let link = document.createElement('a');
|
let link = document.createElement('a');
|
||||||
link.textContent = `${result.title} (${result.year})`;
|
link.textContent = `${result.title} (${result.year})`;
|
||||||
link.href = "#"; // Set a placeholder href
|
link.href = "#"; // Set a placeholder href
|
||||||
link.addEventListener('click', function(event) {
|
link.addEventListener('click', function(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
generateDynamic(result.link);
|
generateDynamic(result.href);
|
||||||
});
|
});
|
||||||
listItem.appendChild(link);
|
listItem.appendChild(link);
|
||||||
resultList.appendChild(listItem);
|
resultList.appendChild(listItem);
|
||||||
|
@ -57,8 +56,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function generateDynamic(href) {
|
function generateDynamic(href) {
|
||||||
if (href) {
|
if (href && href.startsWith('/')) {
|
||||||
fetch(`https://filmer.anorak01.top/vid/${href.split("//")[1]}`)
|
fetch(`https://filmer.anorak01.top/vid/${href.split("/")[1]}`)
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
if (data.url) {
|
if (data.url) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue