...

View Full Version : online - offline check



wouter
01-18-2003, 12:45 PM
Is there a possibility to check is the browser is working offline or online? - only a client-side solution is possible.

Tx

Borgtex
01-18-2003, 03:21 PM
use navigator.onLine, that returns true/false

jalarie
01-20-2003, 02:57 PM
But "navigator.onLine" doesn't work in Netscape. I use an image tag to check; you might be able to do something with this:

&nbsp;<script type="text/javascript">
&nbsp;&nbsp;Now=new Date();
&nbsp;&nbsp;Out ='<img src="http://my.com_gren.gif';
&nbsp;&nbsp;Out+='?'+Now*1;
&nbsp;&nbsp;onerror="this.src=\'_red.gif\'"/>\n';
&nbsp;&nbsp;document.write(Out);
&nbsp;</script>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum