petr 4 years ago
commit
e4d425515a
  1. 35
      index.html

35
index.html

@ -0,0 +1,35 @@
<!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 id="mista"></div>
<script src="https://code.jquery.com/jquery-3.6.0.js"></script>
<script>
$.ajax({
dataType: "json",
url: "http://pak.asgard.odbornaskola.cz/paks/",
headers: {
Authorization: "Token f81ba6fa563046e52a8ab6b7a0e5b1e8bd6b4a0e"
}
})
.done(function(data){
console.log(data);
for (let index = 0; index < data.length; index++) {
const item = data[index];
$("#mista").append("<p>" + item.name + "</p>");
}
})
.fail(function(){
console.log("chyba...");
});
</script>
</body>
</html>
Loading…
Cancel
Save