Here is the code:
function getTime(j){
var stopClock= new Date();
delta[parseInt(j)]=stopClock.getMilliseconds()-start.getMilliseconds();
}
//REST OF THE CODE!!
for (var i = 0; i < 6; i++){
start = new Date();
document.write('<img src="'+URL[i]+'" width="1" height="1" alt="" onload="getTime('+i+');"/>');
}
the problem is sometimes in some values of j (e.g. 3 or 5) it says getTime is not defined! (most of the time is fine)...
I know the it may be because of the fact that when it reaches to that onload line it may not have loaded getTime function yet, but getTime function is at the top of the code and many of the getTime has response...