1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 |
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=GBK"> <link rel="stylesheet" href="/portal/css/index.css" type="text/css"> <title>网络速度指数测试----蓝色新感觉</title> <style type="text/css"> <!-- body { background-image: url(/HAS_Client/buy/img/host_speed.jpg); } --> </style> </head> <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td align='center'> <script language="Javascript"> tim = 1; setInterval("tim++", 10); b = 1; var autourl = new Array(); autourl[1] = "cb-h4.hichina.com"; autourl[2] = "cz-h1.hichina.com"; function check() { var formplace = ""; //首页主机放置地点测试 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>网络速度指数测试<br>"); for (var i = 1; i < autourl.length; i++) { document.write("<br><input type=text name=txt" + i + " size=32 value=测试中……>") } document.write("<br><br>"); document.write("<p id='anti' style='Display:none'>在您本地访问<font color=red><span id='hostplace'></span></font>机房速度较快,推荐选择."); document.write("<input type=hidden name=vstyle value=ok>"); document.write("<br><input type=submit name=ok value='重新测试'><input type=button name=h value=' 关 闭 ' onclick='window.close()'></p></form>"); } function auto(url) { var urlName; if (url == "http://cb-h4.hichina.com") { urlName = "中国电信"; } else { urlName = "中国网通"; } if (tim > 4000) { document.forms[0]["txt" + b].value = urlName + "链接超时"; } else { document.forms[0]["txt" + b].value = urlName + "机房速度指数:" + adv_format(18000 / tim, 2); } if (b == 2) { document.all["anti"].style.display = ''; document.all["hostplace"].innerText = (document.forms[0].txt1.value).substr(0, 4); } b++; } function run() { for (var i = 1; i < autourl.length; i++) { setTimeout("EditTimeout" + i + "('" + autourl[i] + "')", 45000); document.write("<img src=http://" + autourl[i] + "/test_pic.jpg?" + Math.random() + " width=1 height=1 onLoad=auto('http://" + autourl[i] + "')> ") //document.write("<img src=http://"+autourl[i]+"/"+Math.random()+" width=1 height=1 onerror=auto('http://"+autourl[i]+"')>"); } } function EditTimeout1(url) { var urlName; if (url == "cb-h4.hichina.com") urlName = "中国电信"; else urlName = "中国网通"; 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 == "cb-h4.hichina.com") urlName = "中国电信" else urlName = "中国网通" 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 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, i; a = 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 } butt(); run(); </script> </td> </tr> </table> </body> </html> |