Created
March 29, 2016 10:39
-
-
Save seanmavley/734dbd5ec268d93b25f0 to your computer and use it in GitHub Desktop.
check network connectivit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Register listeners | |
window.addEventListener("offline", function(){ | |
$('#globalDiv').hide(); | |
$("#message").html('WARNING: Internet connection has been lost.').show(); | |
}); | |
window.addEventListener("online", function(){ | |
$("#message").empty().hide(); | |
$('#globalDiv').show(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment