Wikipedia Viewer XMLHttpRequest help

I need help with my Wikipedia Viewer. I am trying to use just JavaScript without JQuery so it looks like

    var xhr = new XMLHttpRequest();
    xhr.open('GET', searchURL, true);
    xhr.onload = function() {
        if (xhr.status === 200) {
            setResults(JSON.parse(xhr.responseText));
        } else {
            console.log('Request failed. Returned ' + xhr.status);
        }
    };
    xhr.send();

Here is the link to the entire Pen: Codepen

I’ve been working on this in my free time for over three weekend I’ve successfully used XMLHttpRequest for other API’s and I prefer it over JQuery so I’d like to stay with it if possible.

*note: I have walked through this step by step using the Firefox debugger and I couldn’t figure out what is wrong because if I copy and paste the link into the browser it gives the proper JSON file. Which makes it more frustrating.

Try adding event.preventDefault() at the end of your search function.
Which prevents default form behavior of reloading the page.

To get the event object your function will need to have this signature:

function search(event) {
  ...
  event.preventDefault();
}