forked from irfanshadikrishad/JavaScript101
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
17 lines (16 loc) · 673 Bytes
/
script.js
File metadata and controls
17 lines (16 loc) · 673 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
setInterval(status, 1000);
function status() {
var sts = window.navigator.onLine;
if (sts) {
document.getElementById("status").innerHTML = "online";
document.getElementById("status").style.color = "green";
document.getElementById("statusicon").src = "img/worldwide.png";
document.getElementById("offlinemsg").style.display = "none";
} else {
document.getElementById("statusicon").src = "img/network.png";
document.getElementById("status").innerHTML = "offline";
document.getElementById("status").style.color = "red";
document.getElementById("offlinemsg").innerHTML =
"Please check your internet connection and try again";
}
}