la der
This commit is contained in:
parent
8793fd5c0c
commit
28e38a479e
|
@ -23,7 +23,7 @@
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section id="recherche">
|
<section id="recherche">
|
||||||
<form action="" id="formRecherche" onSubmit="event.preventDefault(); console.log('click')">
|
<form action="" id="formRecherche" onSubmit="envoiForm(event); console.log('click')">
|
||||||
<label for="textRecherche">Recherche : </label>
|
<label for="textRecherche">Recherche : </label>
|
||||||
<input type="text" name="textRecherche" id="textRecherche">
|
<input type="text" name="textRecherche" id="textRecherche">
|
||||||
<input type="submit" value="ok">
|
<input type="submit" value="ok">
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
import { api_call } from './util';
|
import { api_call } from './util';
|
||||||
|
|
||||||
const films = document.getElementById("resultats");
|
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
|
const API_URL = "https://swapi.dev/api/films/"; // déclare la localisation de la liste des films
|
||||||
|
|
||||||
function remplissage(EPISODES){
|
function remplissage(EPISODES){
|
||||||
|
@ -27,5 +29,13 @@ function remplissage(EPISODES){
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function envoiForm(event){
|
||||||
|
|
||||||
|
event.preventDefault();
|
||||||
|
api_call(API_SEARCH+search, remplissage)
|
||||||
|
console.log(formenvoyé);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
api_call(API_URL, remplissage);
|
api_call(API_URL, remplissage);
|
|
@ -86,10 +86,11 @@ console.log('personnage.js loaded');
|
||||||
</div>
|
</div>
|
||||||
</section>`;
|
</section>`;
|
||||||
|
|
||||||
|
}
|
||||||
//Pagination
|
//Pagination
|
||||||
createPagination(previousUrl, nextUrl, PERSONNAGES, remplissage);
|
createPagination(previousUrl, nextUrl, PERSONNAGES, remplissage);
|
||||||
}
|
}
|
||||||
|
|
||||||
api_call(API_URL + "/people", remplissage);
|
api_call(API_URL + "/people", remplissage);
|
||||||
console.log('personnage.js loaded');
|
console.log('personnage.js loaded');
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue