cynic 4 years ago committed by GitHub
parent d0d83d5afa
commit 05a77daf5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      index.html
  2. 23
      main.js

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="main.js"></script>
<script>
load();
</script>
</head>
<body>
<h1 id="title">loading...</h1>
<table id="listing">
</table>
</body>
</html>

@ -0,0 +1,23 @@
function parseinfo(info)
{
document.getElementById("title").innerHTML = info["name"];
console.log(info);
}
function loadmangos(info)
{
let listing = document.getElementById("listing");
info.forEach(manga => function(manga)
{
console.log(manga["id"]);
});
console.log(info);
}
function load(url = "https://test.cynic.moe")
{
fetch(url+"/info")
.then(response => response.json())
.then(data => parseinfo(data));
fetch(url+"/manga/search?sort")
.then(response => response.json())
.then(data => loadmangos(data));
}
Loading…
Cancel
Save