how to check if user lost internet connection
Sometimes losing time on the web I noticed some websites have specific ways to deal with a user who has lost his connections. I wonder how. Is there an event that fires when this happens?
10 Replies
MDN Web Docs
Window - Web APIs | MDN
The Window interface represents a window containing a DOM document; the document property points to the DOM document loaded in that window.
When a user loses his internet connection, how much time it takes for this to happen?
Should be as soon as the OS notices
could take a few seconds. i remember vaguely the browsers are checking the status every x-time
It is a tricky one because it can returns false positivies
that is navigator.online property, different rom the online/offline events
The online /offline events is based on that property
🤠I can't read
As here says
yup