appel API

This commit is contained in:
HarmandI 2021-10-19 10:36:21 +02:00
parent b929d131b8
commit 484c098937
2 changed files with 37 additions and 7213 deletions

7222
package-lock.json generated

File diff suppressed because it is too large Load Diff

28
scripts/personnages.js Normal file
View File

@ -0,0 +1,28 @@
import { api_call } from "./util";
const personnages = document.getElementById("resultats");
console.log('personnage.js loaded');
api_call("people", console.log);
function remplissage(json){
console.log(json.results[0]);
api_call("planets/1", (response) => {
console.log(response);
});
personnages.innerHTML =
`<section class="resultat">
<h1 class="titreAccordeon"></h1>
<div class="accordeon">
<div class="1"> 1</div>
<div class="2"> 2</div>
<div class="3"> 3</div>
</div>
</section>`;
}
api_call("planets", remplissage);