planet start
This commit is contained in:
parent
8bb642383d
commit
f5b9fb28de
Binary file not shown.
|
@ -482,7 +482,7 @@
|
|||
},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"start": "parcel planets.html"
|
||||
"start": "parcel index.html"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
|
@ -20,6 +20,10 @@
|
|||
</nav>
|
||||
</section>
|
||||
|
||||
<section id="resultats">
|
||||
|
||||
</section>
|
||||
|
||||
<section class="results">
|
||||
|
||||
</section>
|
||||
|
|
|
@ -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);
|
Loading…
Reference in New Issue