Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jeffersonchaves/0a1319508a7105eaf36cff136c0e2852 to your computer and use it in GitHub Desktop.
Save jeffersonchaves/0a1319508a7105eaf36cff136c0e2852 to your computer and use it in GitHub Desktop.
teams.html
<!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