HTML5 · Javascript · Professional

Detecting online/offline status

Detecting whether the browser is online or not. navigator.onLine is working fine in Mozilla Firefox and Opera Using the code var onlineOfflineStatus=navigator.onLine ? ‘online’ : ‘offline’; alert(onlineOfflineStatus); But this code not work in Chrome Use ajax jquery var connectSuccess = 0; $.ajax({ type: “POST”, url: ‘onlineOfflineTested.php’, cache: false, dataType: “html”, success: function(data){ connectSuccess = 1;… Continue reading Detecting online/offline status