Offline.js is a JavaScript library to detect if a user is connected to the internet or not. It displays an alert message when the internet connection is lost similar to Facebook and Gmail.
It has different types of themes like – Default, Chrome, Dark, Hubspot, and Side to display alert message.
By default, it uses favicon.ico to check the internet connection but you can change it.
In this tutorial, I show how you can check if user is online or offline using the Offline.js library.



