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
+ 46
0
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css"
integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N" crossorigin="anonymous">
<title>Trainers</title>
<link rel="icon" type="image/x-icon" href="/pokemon/favicon.ico">
</head>
<body>
<script src="js/requests.js"></script>
<script>
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>
<h1>Trainers</h1>
<button type="button" onclick="loadShit()">Update</button>
<div class="container">
<div class="row">
<div id="tableDiv" class="col-8"></div>
<div id="detailsDiv" class="col-4"></div>
</div>
</div>
</body>
</html>
\ No newline at end of file
Loading