
1 changed files with 46 additions and 0 deletions
@ -0,0 +1,46 @@ |
|||||
|
<!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"> |
||||
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x" crossorigin="anonymous"> |
||||
|
<title>api test</title> |
||||
|
</head> |
||||
|
<body> |
||||
|
<div id="mista"> |
||||
|
<ul> |
||||
|
<li>Pošta</li> |
||||
|
<li>PPL</li> |
||||
|
<li>Osobni odber</li> |
||||
|
</ul> |
||||
|
</div> |
||||
|
|
||||
|
|
||||
|
<script |
||||
|
src="https://code.jquery.com/jquery-3.6.0.min.js" |
||||
|
integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" |
||||
|
crossorigin="anonymous"> |
||||
|
</script> |
||||
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/js/bootstrap.bundle.min.js" integrity="sha384-gtEjrD/SeCtmISkJkNUaaKMoLD0//ElJ19smozuHV6z3Iehds+3Ulb9Bn9Plx0x4" crossorigin="anonymous"></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…
Reference in new issue