Created
May 17, 2016 23:54
-
-
Save paulfarino/165a1b90d367df0ae2e5990f8ae7d707 to your computer and use it in GitHub Desktop.
Displays message a message to a user who is offline
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
// Displays message a message to a user who is offline | |
// Example using Boostrap classes | |
// <div id="offline" class="alert alert-danger">You're offline</div> | |
if (navigator.onLine) { | |
document.getElementById('offline').style.display = "block"; | |
} else { | |
console.log('User is online') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment