How to check online/offline status
- Предыдущая страница Удалить атрибут
- Следующая страница Найти скрытый элемент
Learn how to use JavaScript to detect whether the browser is online or offline.
Offline detection
navigator
of the object onLine
The property returns a boolean value to determine whether the browser is in online or offline mode:
Example
Check if the browser is online:
var x = "Is the browser online? " + navigator.onLine;
- Предыдущая страница Удалить атрибут
- Следующая страница Найти скрытый элемент