<span id=url1></span><br>
<span id=url2></span>
<script language="javascript">
function butt(){
tim=1
setinterval("tim++",100)
b=1
autourl1="http://www.dev_club.com/club/bbs/bbsview.asp?boardid=1"
autourl2="http://www.devclub.com/club/bbs/bbsview.asp?boardid=1"
url1.innerhtml=" 测试连接:http://www.dev_club.com/club/bbs/bbsview.asp?boardid=1,测试中….. "
url2.innerhtml=" 测试连接:http://www.devclub.com/club/bbs/bbsview.asp?boardid=1,测试中….. "
}
function auto(url){
if(tim>20) { 这个20是关键.20代表2秒.我是假设2秒没反映就认为是连接错误
document.all(url).innerhtml=" 链接超时 "
}else{
document.all(url).innerhtml=" "+tim/10+"秒 "
}
b++
}
function run(){
document.write("<img src="+autourl1+"/"+math.random()+" width=1 height=1 onerror=auto(url1)>")
document.write("<img src="+autourl2+"/"+math.random()+" width=1 height=1 onerror=auto(url2)>")
}
butt()
run()
</script>
