HTML API Online / Offline events (Javascript)

Date: 2018-10-12
window.addEventListener('load', function() {
  function updateOnlineStatus(event) {
    var condition = navigator.onLine ? "online" : "offline";
    alert(condition);
  }

  window.addEventListener('online',  updateOnlineStatus);
  window.addEventListener('offline', updateOnlineStatus);
});
14320cookie-checkHTML API Online / Offline events (Javascript)