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.onLine
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.protocol=="http:"
or you can buold an hash array of valid protocols
myprots=[];
myprots["http:"]=1;
myprots["ftp:!]=1; //etc...
then
if(myprots[location.protocol]){/*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 said:
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!