Server speed test code

Source: Internet
Author: User
Tip: you can modify some code before running

<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>Js server speed test code</title><style type="text/css">{} A: active {font-size: 9pt} a: visited {font-size: 9pt} legend {font-size: 9pt} a: link {font-size: 9pt} a {font-size: 9pt} a: link {font-size: 9pt} a {font-size: 9pt} address {font-size: 9pt} ul {font-size: 9pt} tr {font-size: 9pt} fieldset {font-size: 9pt} body {SCROLLBAR-HIGHLIGHT-COLOR: # ffffff; SCROLLBAR-SHADOW-COLOR: A1A0A5; SCROLLBAR-3DLIGHT-COLOR: # A1A0A5; SCROLLBAR-TRACK-COLOR: # efefef; SCROLLBAR-DARKSHADOW-COLOR: #97aab1; td, p, input, font, select, option, textarea, form {font-family:; font-size: 9px} td {table-layout: fixed} a: link {text-decoration: none} a: visited {text-decoration: none} a: hover {text-decoration: underline} a: active {text-decoration: none; font-size: 12px }. table {border-collapse: collapse; background-color: # ffffff; border-left: 1px solid #000000; border-right: 1px solid #000000 }. border {border-collapse: collapse; color: #000000; background-color: # EFEFEF; border: 1px dotted #111111 }. time {font-family: Arial; font-size: 11px }. shadow1 {font-size: 12px; filter: dropshadow (color = # d5d5d5, offx = 1, offy = 1); color: #000000 }. shadow2 {font-size: 12px; filter: dropshadow (color = #111111, offx = 1, offy = 1); color: # ffffff }. listnews {font-family:; font size = 14px; line-height: 150% }. p1 {color: # D60303; font-size: 12px; text-decoration: none }. p2 {color: # ffffff; font-size: 12px; text-decoration: none }. p3 {color: # ff0000; font-size: 12px; text-decoration: none }. p4 {color: #007CD3; font-size: 12px; text-decoration: none }. form {BORDER-BOTTOM: #666666 1px solid; BORDER-LEFT: #333333 1px solid; BORDER-RIGHT: #333333 1px solid; BORDER-TOP: #333333 1px solid }. form1 {BORDER-BOTTOM: # aaaaaa 1px solid; BORDER-LEFT: # aaaaaa 1px solid; BORDER-RIGHT: # aaaaaa 1px solid; BORDER-TOP: # aaaaaa 1px solid; FONT-FAMILY: ""; FONT-SIZE: 9pt; COLOR: #666666 }. form2 {color: #000000; border: 1px solid; border-color: # ffffff }. form3 {color: # FF0000; border: 1px solid; border-color: # ffffff; FONT-FAMILY: ""; FONT-SIZE: 9pt} --></style><style type="text/css"><!--body {background-image: url(/images/host.jpg);}--></style></head><body leftMargin="0" topMargin="0" marginwidth="0" marginheight="0"><table width="80%" border="0" align="center" cellpadding="0" cellspacing="0"><tr><td><script language="Javascript">Tim = 1 setInterval ("tim ++", 10) B = 1var autourl = new Array () autourl [1] = "220.181.123.55" autourl [2] = "61.158.143.1" function check () {var formplace = "" // home page host placement test formplace = "if (typeof (formplace) =" object ") {for (I = 0; I<formplace.length;i++){if (((formplace[i].value).split("/"))[1]==document.all["hostplace"].innerText){formplace[i].selected = true; break;} } }}function butt(){document.write("<form name=autof action='' onsubmit='check();'><br>")for(var i=1;i<autourl.length;i++){document.write("<br><br>   <input type=text name=txt"+i+" size=44 value=测试中……>")}document.write("<br><br>")document.write("<p id='anti' >   在您本地访问<font color=red></font>机房速度较快,推荐选择.")document.write("<input type=hidden name=vstyle value=ok>") document.write("<input type=submit name=ok value='刷 新'></p></form>")}butt()function auto(url){var urlName;if (url=="http://220.181.123.55"){ urlName="北京双线"}else{urlName="中国网通"}if(tim>(4000) {document. forms [0] ["txt" + B]. value = urlName + "link timeout"} else {document. forms [0] ["txt" + B]. value = urlName + "data center speed index:" + adv_format (18000/tim, 2)} if (B = 2) {document. all ["anti"]. style. display = ''; document. all ["hostplace"]. innerText = (document.forms%0%.txt 1. value ). substr (0, 4);} B ++;} function run () {for (var I = 1; I<autourl.length;i++){setTimeout("EditTimeout"+i+"('"+autourl[i]+"')",45000)//document.write(" ")document.write("") } }function EditTimeout1(url){var urlName;if (url=="220.181.123.55") urlName="北京双线"elseurlName="中国网通"if(document.forms[0]["txt1"].value =="测试中……")document.forms[0]["txt1"].value=urlName+"链接超时"else if(document.forms[0]["txt2"].value =="测试中……")document.forms[0]["txt2"].value=urlName+"链接超时" document.all["anti"].style.display=''; document.all["hostplace"].innerText = (document.forms[0].txt1.value).substr(0,4);}function EditTimeout2(url){var urlName;if (url=="220.181.123.55") urlName="北京双线"elseurlName="中国网通"if(document.forms[0]["txt1"].value =="测试中……")document.forms[0]["txt1"].value=urlName+"链接超时"else if(document.forms[0]["txt2"].value =="测试中……")document.forms[0]["txt2"].value=urlName+"链接超时" document.all["anti"].style.display=''; document.all["hostplace"].innerText = (document.forms[0].txt1.value).substr(0,4);}run()function MM_openBrWindow(theURL,winName,features) { //v2.0 window.open(theURL,winName,features);}function adv_format(value,num) //四舍五入{var a_str = formatnumber(value,num);var a_int = parseFloat(a_str);if (value.toString().length>A_str.length) {var B _str = value. toString (). substring (a_str.length, a_str.length + 1) var B _int = parseFloat (B _str); if (B _int <5) {return a_str} else {var bonus_str, bonus_int; if (num = 0) {bonus_int = 1;} else {bonus_str = "0. "for (var I = 1; I<num; i++)bonus_str+="0";bonus_str+="1";bonus_int = parseFloat(bonus_str);}a_str = formatnumber(a_int + bonus_int, num)}}return a_str}function formatnumber(value,num) //直接去尾{var a,b,c,ia = value.toString();b = a.indexOf('.');c = a.length;if (num==0){if (b!=-1)a = a.substring(0,b);}else{if (b==-1){a = a + ".";for (i=1;i<=num;i++)a = a + "0";}else{a = a.substring(0,b+num+1);for (i=c;i<=b+num;i++)a = a + "0";}}return a}</script></td></tr></table></body></html>
Tip: you can modify some code before running

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.