how to know connected internet in js

Solutions on MaxInterview for how to know connected internet in js by the best coders in the world

showing results for - "how to know connected internet in js"
Eléonore
09 Jun 2019
1// example code
2let Connected = window.navigator.onLine;
3if (Connected) {
4  alert('Connection available');
5} else {
6  alert('Connection not available');
7}