E
ezmiller
Does anybody know how to use javascript to test whether or not an
internet connection exists? Is this possible even?
internet connection exists? Is this possible even?
ezmiller said:Does anybody know how to use javascript to test whether or not an
internet connection exists? Is this possible even?
Does anybody know how to use javascript to test whether or not an
internet connection exists? Is this possible even?
You could use XMLHttpRequest to see if some resource that you know of on
the internet is available. Not 100% perfect, but should do the trick.
<URL: http://jibbering.com/2002/4/httprequest.html >
I have a bit of code that will detect what type of connection the user
is - well - using. It can detect 3 states "modem" "lan" and "offline."
THIS ISN'T PURE JS because it uses clientcaps behavior which is only
supported in IE.
For more info on this behavior check out:
http://msdn.microsoft.com/workshop/author/behaviors/reference/properties/connectiontype.asp
A page with this code on it should be able, in IE, to detect how the
user got there (modem, lan or offline connection)
You can pretty much see what's going on in here, you can get creative
anywhere after the bodyObj.style.behavior = "url(#default#clientCaps)";
which is where we store what connection type we get:
else
{
//nothing.
}
}//end SSClientCapsWaitForDOM()
try to dowbnload something (eg an img) and wait for the onload to succeed.
how is that?
what's an internet connection ? :^)
Two tin cans and some thread to connect me to the world? said:unique it name by tacking a query onto its name
true it means either there's no connection or there's a problem with the
server, in which case a connection is probably useless anyway.
In many cases they are functionally equivalent
ezmiller said:Does anybody know how to use javascript to test whether or not an
internet connection exists? Is this possible even?
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.