Create better responsive web apps using connectivity status

Did you know it is possible to determine connection status with JavaScript? This feature gives developers a better control of UX by responding appropriately to either online or offline connection status. You can check connectivity status at any time with navigator.onLine, which holds either true or false. It’s also possible to listen to status change using online and offline event names. Open the following link to see a small demo. Try to disconnect from the internet and see how UI will react to this change, then connect and see the behaviour again.

https://jsbin.com/tahekig/edit?output

Is it new? Surprise, surprise! It works in all browsers prior to IE8.