Quantcast
Channel: User Jack - Stack Overflow
Viewing all articles
Browse latest Browse all 40

detect change on navigator.online

$
0
0

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');}

Viewing all articles
Browse latest Browse all 40

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>