都来研究一下下面的代码的原理,,速度测试!!
<script>
tim=1
setInterval("tim++",100) //这是什么作用??
b=1
var autourl=new Array()
autourl[1]="http://stady.51.net/"
function butt(){
document.write("<form name=autof>")
for(var i=1;i<autourl.length;i++)document.write("<input type=text name=txt"+i+" size=10 value=测试中…… class=buttonface>==><input type=text name=url"+i+" size=60 class=buttonface><br>")
document.write("<input type=button value=重新测试速度 onclick=top.location=self.location
class=buttonface></form>")
}
butt()
function auto(url){
document.forms[0]["url"+b].value=url
if(tim>200)
{document.forms[0]["txt"+b].value="链接超时"}
else
{document.forms[0]["txt"+b].value="时间"+tim/10+"秒"}
b++
}
function run(){for(var i=1;i<autourl.length;i++)document.write("<img src="+autourl[ i
]+"/"+Math.random()+" width=1 height=1 onerror=auto('"+autourl[ i ]+"')>")}
run()</script>