const doAjax = async (actionPath, data) => {
let xhttp = new XMLHttpRequest();

xhttp.onreadystatechange = function() {
    if (this.readyState === 4 && this.status === 200) {
        if (this.responseText != null) {  // this.responseXML if getting XML data
            handleReturnData(JSON.parse(this.responseText));
        } else {
            console.log("No content returned. Check the file path.");
        }
    }
};

xhttp.open("POST", actionPath, true);
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
// Force return to be JSON NOTE: Use application/xml to force XML
xhttp.overrideMimeType('application/json');
xhttp.send(data);
}
