Learn how to detect whether the browser is online or offline with JavaScript.
Read on how to do it in this tutorial: https://www.w3schools.com/howto/howto_js_offline_detection.asp
Offline Detection
The onLine
property of the Navigator
object returns a Boolean value that specifies whether the browser is in online or offline mode.
Try it yourself here: https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_offline_detection
Read more about the Navigator Object in our JavaScript Navigator Tutorial.