LISTEN FOR ONLINE AND OFFLINE EVENTS

When you have two levels of connectivity detection, browser online and offline — which is typically physical media connectivity or in-browser online/offline mode — and network online and offline — which is the actual access online to your web server — you can begin modifying your web application to react properly to both groups of online and offline events: