Skip to content

Instantly share code, notes, and snippets.

@seanmavley
Created March 29, 2016 10:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seanmavley/734dbd5ec268d93b25f0 to your computer and use it in GitHub Desktop.
Save seanmavley/734dbd5ec268d93b25f0 to your computer and use it in GitHub Desktop.
check network connectivit
// 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