Here is a revised way of pinging yahoo using javascript and iframes
that seems to work with Firefox (but Not IE 6) 1.0+ (Deer Park Alpha 1
rv.1.8b2 dated 20 Jun 2005). Pretty nifty that FF has an onload in the
<IFRAME ...> element.
Regarding my prior (post) example... Evidently .getMilliseconds is not
the way to go, despite Danny Goodman saying that it is equivalent to
.getTime
<html><head><title>Ping Testing</title>
<script type='text/javascript'>
function pingTime() {
var endTime=new Date();
alert('ping time in milliseconds: '+
(endTime.getTime()-window.startTime)
+"\nendTime: "+endTime.getTime()
+"\nstartTime: "+window.startTime)
}
</script>
</head>
<body onload="alert('body loaded');
var startTime=new Date();
window.startTime=startTime.getTime()
var imgSrc='http://yahoo.com'+
'?cacheBuster='+Math.random();
var iFrame=document.getElementById('myPingTest');
iFrame.onload=pingTime;
iFrame.src=imgSrc">
<IFRAME id=myPingTest>
</IFRAME>
</body>
</html>
Csaba Gabor from Vienna
Received on Tue Oct 18 02:58:52 2005