Window: online event

The online event of the Window interface is fired when the browser has gained access to the network and the value of Navigator.onLine switches to true.

Example

Window: offline event

The offline event of the Window interface is fired when the browser has lost access to the network and the value of Navigator.onLine switches to false.

Example