From c3df8e4ccc8ab52c7159d3dd5df11e61b3909bb1 Mon Sep 17 00:00:00 2001 From: Vincent Ramiere Date: Tue, 19 Oct 2021 12:02:58 +0200 Subject: [PATCH 1/3] modif films html --- films.html | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/films.html b/films.html index e69de29..5d1f049 100644 --- a/films.html +++ b/films.html @@ -0,0 +1,27 @@ + + + + + + + Brief Star Wars - Films + + + + +

People

+
+ + + +
+ +
+ +
+ + +
+ + + \ No newline at end of file From 5fdf339a29c197eda77a3b365fb60a705f85b74d Mon Sep 17 00:00:00 2001 From: Vincent Ramiere Date: Tue, 19 Oct 2021 12:15:09 +0200 Subject: [PATCH 2/3] modif films js --- scripts/films.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/scripts/films.js b/scripts/films.js index e69de29..e197e91 100644 --- a/scripts/films.js +++ b/scripts/films.js @@ -0,0 +1,27 @@ +const FILMS = document.getElementById('container'); +const API_URL = "https://swapi.dev/api/films"; + + +fetch(API_URL) +.then((reponse) => { + //console.log(reponse); + return reponse.json() +}) +.then(reponseFormat => { + for(let index = 0; index <6; index++){ + //console.log(reponseFormat.results[index]); + const data = reponseFormat.results[index]; + console.log(data); + + FILMS.innerHTML +=` +

${data.title}

+

${data.episode_id}

+

${data.opening_crawl}

+

${data.director}

+

${data.producer}

+

${data.release_date}

+

${data.starships}

+

${data.starships}

+
` +} +}) \ No newline at end of file From adcf848a3d89b2dbc3675976d5f1f5284f86f39e Mon Sep 17 00:00:00 2001 From: Vincent Ramiere Date: Tue, 19 Oct 2021 12:23:37 +0200 Subject: [PATCH 3/3] modif films js --- scripts/films.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/films.js b/scripts/films.js index e197e91..3bbd7b5 100644 --- a/scripts/films.js +++ b/scripts/films.js @@ -8,7 +8,7 @@ fetch(API_URL) return reponse.json() }) .then(reponseFormat => { - for(let index = 0; index <6; index++){ + for(let index = 0; index < reponseFormat.results.length; index++){ //console.log(reponseFormat.results[index]); const data = reponseFormat.results[index]; console.log(data);