?? 8.14 檢測站點的鏈接速度.htm
字號:
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>標題頁</title>
</head>
<body>
<script>
indexArr=0 //連接網站的時間
setInterval("indexArr++",100) //設置循環的定時器
b=1
var autourl=new Array() //設置一個鏈接數組
autourl[1]="mail.163.com"
autourl[2]="www.263.net"
autourl[3]="www.sina.com.cn"
autourl[4]="www.baidu.com"
autourl[5]="www.cctv.com"
function writeBtn(){
document.write("<form name=autof>") //輸出一個提交窗體
for(var i=1;i<autourl.length;i++)
document.write("<input type=text name=txt"+i+" size=12 value=測試中……> =》<input type=text name=url"+i+" size=40> =》<input type=button value=GO onclick=window.open(this.form.url"+i+".value)><br>")
document.write("<input type=submit value=刷新></form>")//輸出一個提交按鈕
}
writeBtn()
function auto(url){
document.forms[0]["url"+b].value=url
if(indexArr>200)
{document.forms[0]["txt"+b].value="鏈接超時"} //如果超時,則提示此信息
else
{document.forms[0]["txt"+b].value="時間"+indexArr/100+"毫秒"} //顯示鏈接站點的時間
b++
}
function run(){
for(var i=1;i<autourl.length;i++) //循環測試鏈接站點的時間
document.write("<img src=http://"+autourl[i]+"/"+Math.random()+" width=1 height=1 onerror=auto('http://"+autourl[i]+"')>")
}
run()
</script>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -