2 function getRecentComments() {
3 let container = document.querySelector("#recent-comments-container");
5 let request = new XMLHttpRequest();
6 request.open('GET', 'http://unremediatedgender.space/isso/latest?limit=5', true);
8 request.onload = function() {
9 if (this.status >= 200 && this.status < 400) {
10 let comments = JSON.parse(this.response);
11 for (let comment of comments.reverse()) {
12 let p = document.createElement('p');
13 let a = document.createElement('a');
14 let text = document.createTextNode(`${comment.author} on ${comment.uri}`);
16 a.href = `${comment.uri}#isso-${comment.id}`;
18 container.appendChild(p);
21 container.textContent = "(could not load recent comments)"
25 request.onerror = function() {
26 "(could not load recent comments)"
32 document.addEventListener("DOMContentLoaded", function() {