manga listing

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

@ -1,6 +1,12 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<style>
tr:nth-child(odd)
{
background-color: rgb(240, 240, 240);
}
</style>
<script type="text/javascript" src="main.js"></script> <script type="text/javascript" src="main.js"></script>
<script> <script>
load(); load();
@ -9,6 +15,11 @@ load();
<body> <body>
<h1 id="title">loading...</h1> <h1 id="title">loading...</h1>
<table id="listing"> <table id="listing">
<tr>
<td><b>title</b></td>
<td><b>author</b></td>
<td><b>last update</b></td>
</tr>
</table> </table>
</body> </body>
</html> </html>

@ -6,9 +6,15 @@ function parseinfo(info)
function loadmangos(info) function loadmangos(info)
{ {
let listing = document.getElementById("listing"); let listing = document.getElementById("listing");
info.forEach(manga => function(manga) info.forEach(manga =>
{ {
console.log(manga["id"]); let row = listing.insertRow(-1);
let title = row.insertCell(-1);
title.innerHTML = manga["titles"][0];
let author = row.insertCell(-1);
author.innerHTML = manga["author"];
let time = row.insertCell(-1);
time.innerHTML = new Date(manga["last_updated"]).toLocaleDateString("en-US");
}); });
console.log(info); console.log(info);
} }

Loading…
Cancel
Save