From 28e38a479e71a05d8c505cd3c26d680fcc8c1b91 Mon Sep 17 00:00:00 2001 From: Blandine Bajard <83599148+BlandineBajard@users.noreply.github.com> Date: Wed, 20 Oct 2021 11:57:27 +0200 Subject: [PATCH] la der --- films.html | 2 +- scripts/films.js | 12 +++++++++++- scripts/personnages.js | 3 ++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/films.html b/films.html index 82671d7..fb70906 100644 --- a/films.html +++ b/films.html @@ -23,7 +23,7 @@
-
+ diff --git a/scripts/films.js b/scripts/films.js index f0d931d..188c173 100644 --- a/scripts/films.js +++ b/scripts/films.js @@ -1,7 +1,9 @@ import { api_call } from './util'; const films = document.getElementById("resultats"); +const search = document.getElementById('recherche'); +const API_SEARCH = "https://swapi.dev/api/films/?search" const API_URL = "https://swapi.dev/api/films/"; // déclare la localisation de la liste des films function remplissage(EPISODES){ @@ -27,5 +29,13 @@ function remplissage(EPISODES){ }) } +function envoiForm(event){ -api_call(API_URL, remplissage); \ No newline at end of file + event.preventDefault(); + api_call(API_SEARCH+search, remplissage) + console.log(formenvoyé); + +} + + +api_call(API_URL, remplissage); diff --git a/scripts/personnages.js b/scripts/personnages.js index 150500c..7d1a6ac 100644 --- a/scripts/personnages.js +++ b/scripts/personnages.js @@ -86,10 +86,11 @@ console.log('personnage.js loaded');
`; - + } //Pagination createPagination(previousUrl, nextUrl, PERSONNAGES, remplissage); } api_call(API_URL + "/people", remplissage); console.log('personnage.js loaded'); +