Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*this is just the part that sends the request, the rest is unnecesary*/
- var ro=true;
- function sendData() {
- if(ep[0]!=null&&sp[0]!=null&&ro){
- var data = {
- "strt":sp,
- "end":ep,
- "blk":blocks,
- "sblk":sblocks,
- "enem":enemies,
- "slft":spikesl,
- "srt":spikesr,
- "su":spikesu,
- "sd":spikesd
- };
- var payload = JSON.stringify(data);
- var XHR = new XMLHttpRequest();
- XHR.addEventListener('load', handledt);
- XHR.open("POST", "submit.php");
- XHR.setRequestHeader('Content-Type', 'application/json');
- XHR.send(payload);
- } else {
- alert("please set player and end portal position");
- }
- ro=false;
- }
- function handledt() {if(this.responseText=="s")location.reload();}
Advertisement
Add Comment
Please, Sign In to add comment