7 lines
219 B
JavaScript
7 lines
219 B
JavaScript
|
const alertOnlineStatus = () => { window.alert(navigator.onLine ? 'online' : 'offline') }
|
||
|
|
||
|
window.addEventListener('online', alertOnlineStatus)
|
||
|
window.addEventListener('offline', alertOnlineStatus)
|
||
|
|
||
|
alertOnlineStatus()
|