No Internet connection how to do?

5b51a4b105d37997680225.jpeg
Saw on one site - this alert how to do JS?
Thank you.
June 3rd 19 at 19:29
2 answers
June 3rd 19 at 19:31
Solution
Check the property window.navigator.onLine
June 3rd 19 at 19:33
Make an ajax request
The answer is no and falls with a timeout, or an error of some kind.
Show notification that no Internet.

Find more questions by tags JavaScript