Edit in JSFiddle

var url = "https://api.icndb.com/jokes/random"

var http = new XMLHttpRequest()

http.onreadystatechange = function() {
    if (this.readyState != 4 || this.status != 200) {
        return
    }
    
    response = JSON.parse(this.responseText)
    document.getElementById("joke").innerHTML = response.value.joke
}
    
function hae() {
    http.open("GET", url)
    http.send()
}
<button onclick="hae()">Vitsi!</button>

<p id="joke">

</p>