網站連接速度測試

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>網站連接速度測試</title>
		<script language="javascript">
		tim=1;
		setInterval("tim++",100);
		b=1;
		var autourl=new Array();
		autourl[1]="www.baidu.com";
		autourl[2]="www.sina.com";
		autourl[3]="www.sohu.com";
		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=loading……>→<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>150)
				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[i]+"/"+Math.random()+" width=1 height=1 onerror=auto('http://"+autourl[i]+"')>")
		}
		run();
</script>
	</head>
	<body>
	</body>
</html>

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章