JSFiddle - React, Tailwind, and code Playground
by caub
JavaScript
ajax('http://vps144972.ovh.net/so/questions/34738694/how-to-move-items-on-the-screen-for-a-game-using-javascript').then(function(r){
console.log(r);
});
function ajax (url, meth, body, headers) {
var xhr = new XMLHttpRequest();
xhr.open(meth || 'GET', url);
// for (var i in headers)
// xhr.setRequestHeader(i, headers[i]);
xhr.send(body);
return new Promise(function (resolve) {
xhr.onload = function () {
resolve(xhr.response);
};
});
}