Hi!
I'm messing with the following code:
function check(){
var connect_img=new Image();
connect_img.onload=good_connect;
connect_img.onerror=bad_connect;
connect_img.src=" }
checkconnect=setInterval('check()',10000);
For the lines:
connect_img.onload=good_connect;
connect_img.onerror=bad_connect;
good_connect and bad_connect are functions that simply kick back a javascript alert.
While I'm testing for the existance of an image I'm actually testing to see if an internet connection is up and running...Everything works like it should when I first launch the script. However, if I unplug the ethernet cable to my pc while the script runs, the alert state doesn't change like I think it should. I thought defining the variable connect_img each time the function is called would do the trick but maybe I'm just not doing it right. Any thoughts would be great!
-dle
I'm messing with the following code:
function check(){
var connect_img=new Image();
connect_img.onload=good_connect;
connect_img.onerror=bad_connect;
connect_img.src=" }
checkconnect=setInterval('check()',10000);
For the lines:
connect_img.onload=good_connect;
connect_img.onerror=bad_connect;
good_connect and bad_connect are functions that simply kick back a javascript alert.
While I'm testing for the existance of an image I'm actually testing to see if an internet connection is up and running...Everything works like it should when I first launch the script. However, if I unplug the ethernet cable to my pc while the script runs, the alert state doesn't change like I think it should. I thought defining the variable connect_img each time the function is called would do the trick but maybe I'm just not doing it right. Any thoughts would be great!
-dle