connection - How can I define if my pc has access to internet with javascript? -


i developing chrome extension application, , using javascript check if users connected network.
var statuselem = document.getelementbyid('status');

var intervalid = setinterval(function () {   if (navigator.online) {     // clear interval     clearinterval(intervalid);      // you're online. redirect desired url     window.location = "popup.html";   }   else {     statuselem.classname = 'offline';     statuselem.innerhtml = '<span style="color: red">connect device internet</span>';   } }, 500); 

but doesen't check if network connection has access internet, there anyway check if sending or receiving data internet?

if it's fine use library, can take @ - http://github.hubspot.com/offline.


Comments

Popular posts from this blog

How to provide Authorization & Authentication using Asp.net, C#? -

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

How to use Authorization & Authentication in Asp.net, C#? -