Skip to content
Snippets Groups Projects

Trainer table with pictures

Closed Tőzsér, Á. (Adam, Student B-TCS) requested to merge (removed):main into main
@@ -16,23 +16,25 @@
<script src="js/requests.js"></script>
<script>
tableParentId = "tableDiv";
detailsParentId = "detailsDiv";
function loadShit() {
tableParentId = "tableDiv";
detailsParentId = "detailsDiv";
fetch('/pokemon/api/trainers/')
.then(res => res.json())
.then(data => {
trainers = data;
createTrainerTable();
})
.catch(err => {
console.error(`Unable to fetch trainers: ${err.status}`);
console.error(err);
});
</script>
fetch('/pokemon/api/trainers/')
.then(res => res.json())
.then(data => {
trainers = data;
createTrainerTable();
})
.catch(err => {
console.error(`Unable to fetch trainers: ${err.status}`);
console.error(err);
});
}
</script>
<h1>Trainers</h1>
<button type="button" onclick="loadShit()">Update</button>
<div class="container">
<div class="row">
<div id="tableDiv" class="col-8"></div>
Loading