update films.js

This commit is contained in:
Vincent Ramiere 2021-10-19 16:31:40 +02:00
parent fb61e9dfd7
commit 5bc631e887

View File

@ -15,6 +15,9 @@ async function getMovies() {
// boucle pour parser les films // boucle pour parser les films
for(i=0;i<FILM.results.length;i++){ for(i=0;i<FILM.results.length;i++){
const TITRE = FILM.results[i].title; const TITRE = FILM.results[i].title;
const EPISODE = FILM.results[i].episode_id;
const OPENING = FILM.results[i].opening_crawl;
// const planets = await fetch(people.results[i].homeworld); // const planets = await fetch(people.results[i].homeworld);
// const planet = await planets.json(); // const planet = await planets.json();
//console.log(hero+' '+planet.name); //console.log(hero+' '+planet.name);
@ -32,6 +35,12 @@ async function getMovies() {
document.getElementById('container').innerHTML += ` document.getElementById('container').innerHTML += `
<p> <p>
<h2>${TITRE}</h2> <h2>${TITRE}</h2>
<p>${EPISODE}</p>
<p>${OPENING}</p>
<p>${DIRECTOR}</p>
<p>${PRODUCER}</p>
<p>${DATE}</p>
<button class="starships" value="${FILM.results[i].starships}">Voir les vaisseaux</button> <button class="starships" value="${FILM.results[i].starships}">Voir les vaisseaux</button>
<div id="detailsStarships${i}"></div> <div id="detailsStarships${i}"></div>
<button class="species" value="${FILM.results[i].species}">Voir les especes</button> <button class="species" value="${FILM.results[i].species}">Voir les especes</button>