It would be nice if you can check for connectivity status( online/offline ) of the user. So you can check if the user is online/offline by polling the navigator.onLine property.
Example:
(function () { setInterval(function () { var NetworkStatus = document.getElementById("status"), isOnline = navigator.onLine; if (isOnline) { NetworkStatus.innerHTML = "Online"; NetworkStatus.className = "online"; } else { NetworkStatus.innerHTML = "Offline"; NetworkStatus.className = "offline"; } }, 100); })(); Add the element inside HTML5 body. <h1 id="status"></h1> You can also add some css style for more effects. .online { color: green; } .offline { color: red; }