JS/TP04/EX03/app.js
2024-03-08 16:34:15 +01:00

24 lines
663 B
JavaScript

import {tableManager} from './modules/table';
import loader from './modules/loader';
let leagues = [];
let url = "https://www.thesportsdb.com/api/v1/json/3/lookuptable.php?l=4334&s=2023-2024";
let leagueList = document.querySelector(".menu-list");
let table = new tableManager(document.querySelector("table tbody"));
let loaderDiv = new loader(document.getElementById("loader"));
async function getEquipeFoot(){
try{
return (await fetch(url)).json();
}
catch(error){
console.error(error);
return null;
}
}
let equipeFoot = await getEquipeFoot();
console.log(equipeFoot);
table.setData(equipeFoot);
table.tableRender();