Commit efa150ca authored by Luca Silly's avatar Luca Silly
Browse files

page recherche début

parent 9da21fff
Pipeline #21276 failed with stages
in 30 seconds
......@@ -33,8 +33,6 @@
</header>
<span id="test">t</span>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="index.css">
<script src="test.js"></script>
<script defer src="https://use.fontawesome.com/releases/v5.14.0/js/all.js"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<title>CUI Portfolio</title>
</head>
<body>
<header>
<div class="header-right">
<img src="images/profil.png" alt="profil" id="profil_user">
</div>
<div id="chercher">
<input type="text" placeholder="Cherchez un projet..." id="search">
<button type="submit" class="searchButton" id="submit" onclick="rechercher()">
<i class= "fas fa-search" ></i>
</button>
</div>
<div class="header-left">
<img src="images/logo.png" alt="logo" id="logo">
<div id="logo_couleur">
<p id="title">Portfolio CUI</p>
</div>
</div>
</header>
<div id="projet">bonjour</div>
</body>
</html>
\ No newline at end of file
......@@ -17,13 +17,19 @@ function rechercher(){
var motRecherche = document.getElementById("search").value;
axios.get('http://127.0.0.1:2555/recherche/', { params: { motClef : motRecherche } })
.then(response => {
var listeTitresProjets = "";
window.location='recherche.html';
for(var i=0; i<response.data.length;i++){
}
/*var listeTitresProjets = "";
for(var i = 0; i < response.data.length; i++){
listeTitresProjets = listeTitresProjets + response.data[i].titre_projet;
if (i < response.data.length-1)
listeTitresProjets = listeTitresProjets + ", ";
}
document.getElementById("test").innerHTML= listeTitresProjets;
document.getElementById("test").innerHTML= listeTitresProjets;*/
})
.catch(error => {
console.log(error)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment