Created
February 9, 2023 10:55
-
-
Save jeffersonchaves/0a1319508a7105eaf36cff136c0e2852 to your computer and use it in GitHub Desktop.
teams.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Document</title> | |
</head> | |
<body> | |
<div class="container"> | |
<h1>Álbum de IFigurinhas</h1> | |
<div id="selecoes"> | |
<!-- aqui serão injetadas "magicamente" as seleçoes --> | |
</div> | |
</div> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/axios/1.3.1/axios.min.js"></script> | |
<script> | |
axios.get("http://localhost:8080/selecoes").then(function(resposta){ | |
//console.log(resposta.data); | |
var containerSelecoes = document.getElementById('selecoes'); | |
var selecoes = resposta.data; | |
for(i in selecoes){ | |
var coluna = document.createElement("div"); | |
coluna.classList.add("coluna"); | |
coluna.innerHTML = selecoes[i].team_name; | |
containerSelecoes.appendChild(coluna); | |
} | |
}).catch(function(resposta){ | |
console.log(resposta); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment