1. 程式人生 > >檢測某個網站的鏈接速度代碼分享

檢測某個網站的鏈接速度代碼分享

name 到你 () auto random tour ext UNC array

小夥伴們是否想檢測網站的速度,那麽下面的代碼一定能幫助到你們!

把如下代碼加入<body>區域中:
<script language=Javascript>
tim=1
setInterval("tim++",100)
b=1
var autourl=new Array()
autourl[1]="www.xxxx.xxx"
autourl[2]="xxx.3322.xxx"
autourl[3]="xxx.xx.xxx"
autourl[4]="xxx.xxx.xxx"
autourl[5]="xxx.xxx.xxx"
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=測試中

……> =》<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>")

}
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=http://"+autourl+"/"+Math.random()+" width=1 height=1 nerror=auto("http://"+autourl+"")>")}
run()</script>

檢測某個網站的鏈接速度代碼分享

檢測某個網站的鏈接速度代碼分享