Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Oct 2002
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    online - offline check

    Is there a possibility to check is the browser is working offline or online? - only a client-side solution is possible.

    Tx

  • #2
    Regular Coder
    Join Date
    Aug 2002
    Location
    Spain
    Posts
    420
    Thanks
    0
    Thanked 0 Times in 0 Posts
    use navigator.onLine, that returns true/false
    Don't resist to assimilation. Billions of Borgs can't be wrong!

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    Flint, Michigan, USA
    Posts
    620
    Thanks
    1
    Thanked 20 Times in 20 Posts
    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>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •