1. Home
  2. Javascript
  3. Offline online network
#javascript

Add event listeners for checking the network status. Capturing those events lets you handle offline and online status of the application.

window.addEventListener('online', ()=> console.log("online"));
window.addEventListener('offline', ()=> console.log("offline"));
copy
Full Javascript cheatsheet
Sitemap Git repository