How can I detect if the navigator changed your state to online/offline?
something like:
var oldState = navigator.onLine;
window.navigator.onlinechange = function(evnt,newState) {
alert('your changed from' + oldState + ' to' + newState + 'state');
}
With the help of classes on body and this code you can find
window.ononline = function() {
alert('You are now online');
}
window.onoffline = function() {
alert('You are now offline');
}