I am running a script I got from
www.huntip.com for determining bandwidth to my web server. The script call a javascript with downloads a large jpg file (around 300K) and calculates the time it takes to download the file and reports the speed to the user.
The huntip.com site works fine in both IE (6 or 7) and fine in Firefox.
So I put these files on my apache server 1.3 I think
and it works fine from firefox but not IE. In IE when the file downloads all I get back is a red x where the JPG should be. I am sure this is a security setting in the browser
or could be a setting in the Apache config.
I am not thinking the apache config as much because firefox works fine, any ideas?
here is the Java script
<html>
<head>
<SCRIPT LANGUAGE='JavaScript'>
var results=new Array(30);
for (i=0;i<20;i++){results[i]=
0;}
function CurrentTime() { time = new Date(); return time.getTime(); }
function speed(instance,starttime) {
endtime = CurrentTime();
F = 1000;
diff = ((endtime - starttime)/F);
DS = 500;
kbps1 = (DS/diff);
kbpsA = ((kbps1*8)*10*1.02);
kbyteA = ((DS*10)/diff);
kbps = (Math.round(kbpsA)/10);
kbyte = (Math.round(kbyteA)/10);
results[instance]=kbps;
done=1;sum=0;
for (i=1;i<20;i++)
{
sum=sum+results[i];
if (results[i]==0){done=0;}
}
if (done==1)
{
document.forms[0].bandwidt
h.value=su
m/19;
document.forms[0].submit()
;
}
}
</SCRIPT>
</head>
<body >
<script>
starttime= CurrentTime();
document.write ("<img src='image2.jpg?r="+startt
ime+"' width='40' onload='speed(1,starttime)
;'>");
document.write ("<img src='image2.jpg?r="+startt
ime+"' width='40' onload='speed(2,starttime)
;'>");
document.write ("<img src='image2.jpg?r="+startt
ime+"' width='40' onload='speed(3,starttime)
;'>");
document.write ("<img src='image2.jpg?r="+startt
ime+"' width='40' onload='speed(4,starttime)
;'>");
document.write ("<img src='image2.jpg?r="+startt
ime+"' width='40' onload='speed(5,starttime)
;'>");
document.write ("<img src='image2.jpg?r="+startt
ime+"' width='40' onload='speed(6,starttime)
;'>");
document.write ("<img src='image2.jpg?r="+startt
ime+"' width='40' onload='speed(7,starttime)
;'>");
document.write ("<img src='image2.jpg?r="+startt
ime+"' width='40' onload='speed(8,starttime)
;'>");
document.write ("<img src='image2.jpg?r="+startt
ime+"' width='40' onload='speed(9,starttime)
;'>");
document.write ("<img src='image2.jpg?r="+startt
ime+"' width='40' onload='speed(10,starttime
);'>");
document.write ("<img src='image2.jpg?r="+startt
ime+"' width='40' onload='speed(11,starttime
);'>");
document.write ("<img src='image2.jpg?r="+startt
ime+"' width='40' onload='speed(12,starttime
);'>");
document.write ("<img src='image2.jpg?r="+startt
ime+"' width='40' onload='speed(13,starttime
);'>");
document.write ("<img src='image2.jpg?r="+startt
ime+"' width='40' onload='speed(14,starttime
);'>");
document.write ("<img src='image2.jpg?r="+startt
ime+"' width='40' onload='speed(15,starttime
);'>");
document.write ("<img src='image2.jpg?r="+startt
ime+"' width='40' onload='speed(16,starttime
);'>");
document.write ("<img src='image2.jpg?r="+startt
ime+"' width='40' onload='speed(17,starttime
);'>");
document.write ("<img src='image2.jpg?r="+startt
ime+"' width='40' onload='speed(18,starttime
);'>");
document.write ("<img src='image2.jpg?r="+startt
ime+"' width='40' onload='speed(19,starttime
);'>");
</script>
<form method=post>
<input type=hidden name=ip value="some IP would be here">
<input type=hidden name=browser value="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1">
<input type=hidden name=bandwidth value="">
<input type=hidden name=action value="result">
</form>
</body>
</html>
------------------------ end script
again works fine in firefox, but not IE.
thanks in advance.