This is an example demonstrating using events in the DOM, specifically to detect changes to network connectivity and online/offline events.
For more technical information about how it works, see the docs on navigator.onLine.
The network is .