Files
Kleeja/styles/bootstrap/js/script.js

17 lines
484 B
JavaScript
Raw Normal View History

2020-05-24 18:19:24 +02:00
function ajaxRemote (method, url, data, successCallback)
{
var xhttp = new XMLHttpRequest();
2020-05-24 18:21:34 +02:00
let sendData = null;
2020-05-24 18:19:24 +02:00
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");
2020-05-24 18:21:34 +02:00
sendData = data;
2020-05-24 18:19:24 +02:00
}
xhttp.send(sendData);
}