mirror of
https://github.com/kleeja-official/kleeja.git
synced 2026-07-28 05:21:56 +02:00
refactore
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
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);
|
||||
@@ -9,7 +10,7 @@ function ajaxRemote (method, url, data, successCallback)
|
||||
xhttp.open(method, url, true);
|
||||
if (method == 'POST') {
|
||||
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
||||
sendData = data;
|
||||
}
|
||||
let sendData = method == 'POST' ? data : null
|
||||
xhttp.send(sendData);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user