let load = function() {
    let xhr = new XMLHttpRequest();
    xhr.open('GET', 'http://localhost:8000/all', true);

    xhr.onload = function (e) {
        if (this.status == 200) {
            // Target
            let target = document.querySelector('#content');
            for (doc of JSON.parse(this.response)['document']) {
                // Setup element
                let t = document.querySelector('#urlrow');
                let a = t.content.querySelector('.url');
                a.innerHTML = doc['url'];
                a.setAttribute('href', doc['url']);

                // Insert
                var clone = document.importNode(t.content, true);
                target.append(clone);
            }
        }
    }
    xhr.send();
}

load();

@@ -1,12 +1,666 @@
+let createTag = function(tag) %7B%0A    let template = document.querySelector('#tagrow');%0A    let el = template.content.querySelector('.tag');%0A    el.innerHTML = tag;%0A%0A    return document.importNode(template.content, true);%0A%7D%0Alet createRow = function(url, tags) %7B%0A    let template = document.querySelector('#urlrow');%0A    let a = template.content.querySelector('.url');%0A    a.innerHTML = url;%0A    a.setAttribute('href', url);%0A%0A    let tagEl = template.content.querySelector('.tags');%0A    tagEl.innerHTML = '';%0A    for (t of tags) %7B%0A        let tag = createTag(t);%0A        tagEl.append(tag);%0A    %7D%0A%0A    return document.importNode(template.content, true);%0A%7D;%0A%0A
 let load = f
@@ -667,24 +667,24 @@
 unction() %7B%0A
-
     let xhr 
@@ -834,30 +834,8 @@
 ) %7B%0A
-            // Target%0A
     
@@ -976,327 +976,52 @@
     
-// Setup element%0A                let t = document.querySelector('#urlrow');%0A                let a = t.content.querySelector('.url');%0A                a.innerHTML = doc%5B'url'%5D;%0A                a.setAttribute('href', doc%5B'url'%5D);%0A%0A                // Insert%0A                var clone = document.importNode(t.content, true);
+let row = createRow(doc%5B'url'%5D, doc%5B'tags'%5D)
 %0A   
@@ -1051,13 +1051,11 @@
 end(
-clone
+row
 );%0A 
@@ -1099,17 +1099,18 @@
 send();%0A
-
 %7D
+;
 %0A%0Aload()

Refactor + add tags.