mirror of https://github.com/kurisufriend/mlFE
parent
d0d83d5afa
commit
05a77daf5e
@ -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…
Reference in new issue