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');
}
Something like this (not every browser supports these events, currently only IE 8,9 and FF > 3 support these events):
The browser support varies, check this out: http://help.dottoro.com/ljnasgpu.php