Files
Kleeja/styles/bootstrap/js/script.js
MitanOmar d8baf915e1 refactore
2020-05-24 18:21:34 +02:00

17 lines
484 B
JavaScript

function ajaxRemote (method, url, data, successCallback)
{
var xhttp = new XMLHttpRequest();
let sendData = null;
xhttp.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {
successCallback(this);
}
};
xhttp.open(method, url, true);
if (method == 'POST') {
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
sendData = data;
}
xhttp.send(sendData);
}