9 lines
267 B
JavaScript
9 lines
267 B
JavaScript
|
function onlineStatusIndicator () {
|
||
|
document.getElementById('status').innerHTML = navigator.onLine ? 'online' : 'offline'
|
||
|
}
|
||
|
|
||
|
window.addEventListener('online', onlineStatusIndicator)
|
||
|
window.addEventListener('offline', onlineStatusIndicator)
|
||
|
|
||
|
onlineStatusIndicator()
|