Hi, I was searching for a solution when internet is not connected or when a week signal is detected and I got the code below from your website. Then I added alert message as you can see below to prevent website from crashing. When I try to use it in my login page, it flickers the page every 4 seconds(the time i set) and the cursor goes back to the Username textbox before I finish entering the password. I set txtUsername.focus on pageload. How do I prevent the page from flickering until I finish entering the username and password.
<script type="text/javascript">
window.onload = function () {
setInterval(function () {
if (navigator.onLine) {
document.forms[0].submit();
}
else
alert("You are not connected to Internet, ensure you’re not in airplane mode. \n\nYour internet signal may be week. \n\nPlease connect to internet and try again.");
}, 4000);
}
</script>