Determine online status?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Daniel Orner

    Determine online status?

    Is it at all possible to use JavaScript to find out if someone's
    online or not? E.g. to try and fetch a URL and figure out if it failed
    or not? I'm trying to add some functionality to my primarily online
    program to also work offline, but I'd need this sort of thing to make
    it work well.

    Thanks!
  • Vicomte De Valmont

    #2
    Re: Determine online status?

    Yes, I'm checking again at:


    in IE the navigator object has a property which might be yours:
    navigator.onLin e
    it returns now true - it means that though I'm checking on my local hard
    disk this file, actually, it detects my system is online...

    If you load the page with NS6 we can find none at least inspecting and
    selecting the porpeties and inspecitng a bit the wealth of data. yet, why
    not checking if the url protocol is http:? That would posiviely say whether
    the user is online, with a marginal error which is not too big (that is:
    page loaded online, but disconnection made while reading it)
    location.protoc ol=="http:"
    or you can buold an hash array of valid protocols
    myprots=[];
    myprots["http:"]=1;
    myprots["ftp:!]=1; //etc...

    then
    if(myprots[location.protoc ol]){/*is ARGUABLY still online*/}

    testing it from the location bar by the "javascript :" 'protocol' it gave to
    me: "javascript :" :-)))

    Just an idea, maybe others have better solutions. Just an idea.
    ciao
    Alberto Vallini



    "Daniel Orner" <cidolfas@rpgcl assics.com> ha scritto nel messaggio
    news:77dd287a.0 310291009.18d79 63c@posting.goo gle.com...[color=blue]
    > Is it at all possible to use JavaScript to find out if someone's
    > online or not? E.g. to try and fetch a URL and figure out if it failed
    > or not? I'm trying to add some functionality to my primarily online
    > program to also work offline, but I'd need this sort of thing to make
    > it work well.
    >
    > Thanks![/color]


    Comment

    • Daniel Orner

      #3
      Re: Determine online status?

      I don't think that would quite work, because I'm more dealing with
      seeing if a user is viewing a page from the cache (i.e. offline) or if
      he's online. If he is viewing something from the cache, the protocol
      will be exactly the same as if he wasn't, if my understanding is
      correct.

      Anyway... after further thought this might not be the best way of
      doing things in any case... but if anyone has any other ideas I'd love
      to hear them. 8-)

      --Daniel

      "Vicomte De Valmont" <NOSPAM@hotmail .com> wrote in message news:<bnpfnu$1n i$1@lacerta.tis calinet.it>...[color=blue]
      > Yes, I'm checking again at:
      > http://www.unitedscripters.com/hotvamps/browsers.html
      >
      > in IE the navigator object has a property which might be yours:
      > navigator.onLin e
      > it returns now true - it means that though I'm checking on my local hard
      > disk this file, actually, it detects my system is online...
      >
      > If you load the page with NS6 we can find none at least inspecting and
      > selecting the porpeties and inspecitng a bit the wealth of data. yet, why
      > not checking if the url protocol is http:? That would posiviely say whether
      > the user is online, with a marginal error which is not too big (that is:
      > page loaded online, but disconnection made while reading it)
      > location.protoc ol=="http:"
      > or you can buold an hash array of valid protocols
      > myprots=[];
      > myprots["http:"]=1;
      > myprots["ftp:!]=1; //etc...
      >
      > then
      > if(myprots[location.protoc ol]){/*is ARGUABLY still online*/}
      >
      > testing it from the location bar by the "javascript :" 'protocol' it gave to
      > me: "javascript :" :-)))
      >
      > Just an idea, maybe others have better solutions. Just an idea.
      > ciao
      > Alberto Vallini
      >
      >
      >
      > "Daniel Orner" <cidolfas@rpgcl assics.com> ha scritto nel messaggio
      > news:77dd287a.0 310291009.18d79 63c@posting.goo gle.com...[color=green]
      > > Is it at all possible to use JavaScript to find out if someone's
      > > online or not? E.g. to try and fetch a URL and figure out if it failed
      > > or not? I'm trying to add some functionality to my primarily online
      > > program to also work offline, but I'd need this sort of thing to make
      > > it work well.
      > >
      > > Thanks![/color][/color]

      Comment

      Working...