Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- getJSON = function (url, sendingData, successHandler, errorHandler = null) {
- let xhr = typeof XMLHttpRequest != 'undefined'
- ? new XMLHttpRequest()
- : new ActiveXObject('Microsoft.XMLHTTP');
- xhr.open('POST', url, true);
- xhr.onreadystatechange = function () {
- let status;
- let data;
- if (xhr.readyState == 4) { // `DONE`
- status = xhr.status;
- if (status == 200) {
- data = xhr.responseText;
- successHandler && successHandler(data);
- } else {
- errorHandler && errorHandler(status);
- }
- }
- };
- xhr.send(sendingData);
- };
- let sendingData = new FormData();
- sendingData.append("pid", 0);
- sendingData.append("i_id", 63);
- sendingData.append("but", 'use');
- getJSON("https://league17reborn.ru/game.php?fun=fight",sendingData, data=>{location.reload()})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement