planet start

This commit is contained in:
William Noris 2021-10-19 09:47:51 +02:00
parent 8bb642383d
commit f5b9fb28de
4 changed files with 26 additions and 1 deletions

Binary file not shown.

View File

@ -482,7 +482,7 @@
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "parcel planets.html"
"start": "parcel index.html"
},
"repository": {
"type": "git",

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);