test log
This commit is contained in:
parent
2fe22ae5b8
commit
f89a12e914
3 changed files with 21 additions and 166 deletions
13
index.js
Normal file
13
index.js
Normal file
|
@ -0,0 +1,13 @@
|
|||
(async function( ){
|
||||
let msgs = await fetch("https://civ.dervland.net/api/messages");
|
||||
let msgJ = await msgs.json();
|
||||
|
||||
for (let msg of msgJ) {
|
||||
let msgC1 = document.createElement('big');
|
||||
msgC1.textContent = `<${msg.username}> (${(new Date(msg.date)+'').split(' GMT')[0]})`;
|
||||
let msgC2 = document.createElement('div');
|
||||
msgC2.textContent = `${msg.content}`;
|
||||
document.querySelector('.msgs').appendChild(msgC1);
|
||||
document.querySelector('.msgs').appendChild(msgC2);
|
||||
}
|
||||
})()
|
Loading…
Add table
Add a link
Reference in a new issue