Fetch API

o.jFetch3 = function () {
    fetch(o.url)
        .then(validate)
        .then(jreduceFetch)
        .then(toDOM)
        .catch(log)
}

XHR: XMLHttpRequest() | Promisified: fetchXHR()

@ Basic GET

document.querySelector('H1').onclick = makeRequest

function makeRequest() {
    var xhr = new XMLHttpRequest()
    xhr.open('GET', '/foo', true)
    xhr.onreadystatechange = function() {
        if(xhr.readyState === XMLHttpRequest.DONE && xhr.status === 200){
            toDOM(xhr) // callback
        }
    }
    xhr.send()
}

var toDOM = (xhr) => {
    var el = document.querySelector('H1'),
        html = `<h2><code>${xhr.responseText}</code></h2>`

    el.insertAdjacentHTML("afterend",html)
    document.querySelector('BODY').prepend(el) // APPENDs to BODY
}

@ JSON POST/GET

// POST
function post(url, data, callback) {
    var xhr = new XMLHttpRequest()

    xhr.open("POST", url, true)
    xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded")
    xhr.onload = function() {
        callback(JSON.parse(xhr.response))
    }

    xhr.send(JSON.stringify(data))
}
// GET
function get(url, callback) {
    var xhr = new XMLHttpRequest()

    xhr.open("GET", url, true)
    xhr.onload = function() {
        callback(JSON.parse(xhr.response))
    };

    xhr.send(null)
}

( XHR | Fetch ) & Render

Various schemes profiled @ JSON payload

tl;dr

Injecting pre-rendered html fragments is very performant, in both network efficiency and DOM manipulation. JSON works as well too. Template literals are great for mapping JSON to html components very quickly; bypasses the per-node javascript code. The DOM performance will suffer some, but the tradeoff is well worth it for most text rendering scenarios, e.g., chat/comments threads and such.