Skip to content

Instantly share code, notes, and snippets.

@gitdagray
Last active July 29, 2020 20:03
Show Gist options
  • Save gitdagray/a74a4038afcb5b6c0d9c7753fc0893cb to your computer and use it in GitHub Desktop.
Save gitdagray/a74a4038afcb5b6c0d9c7753fc0893cb to your computer and use it in GitHub Desktop.
navigator.onLine at page load
window.addEventListener("load", (event) => {
const statusDisplay = document.getElementById("status");
statusDisplay.textContent = navigator.onLine ? "Online" : "OFFline";
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment