Click to See Complete Forum and Search --> : Check an Internet connection from html page


yoramdar
10-07-2003, 03:49 PM
Hi guys,
Please help
I try to burn a CD-ROM, which contains a link to the web, but I don’t know whether the client has an Internet connection.
Is there any way to check whether the client has an active connection to the web?
JavaScript would be the best way for me to implement it.

Thanks.
:confused:

Khalid Ali
10-07-2003, 06:06 PM
you can use an image which you know is always available on a webserver as a resource to find out if threre is an internet connection.

var img = new Image();
img.onerror=new function(){
alert("No Internet connection");
}

img.onload = new function(){
alert("Internet connection exists");
}

img.src = "http://domainName.com/imag.gif"