This commit is contained in:
Blandine Bajard 2021-10-19 10:02:29 +02:00
commit 49e32dd669
2 changed files with 25 additions and 0 deletions

View File

@ -20,6 +20,10 @@
</nav>
</section>
<section id="resultats">
</section>
<section class="results">
</section>

View File

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