power says:
<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>
Hi,
Replace above code with
<script type="text/javascript">
window.onload = function () {
if (!navigator.onLine) {
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.");
}
}
</script>
HTML
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script type="text/javascript">
window.onload = function () {
if (!navigator.onLine) {
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.");
} else {
alert("You are connected to Internet");
}
}
</script>
</head>
<body>
</body>
</html>
Demo
I hope this will help you out.