访问很多网站的时候发现他们都喜欢在首页是列举出很多的镜象服务器地址让用户自己选择进入。如http://www.btbbt.com/ 等。 特别是中国,网通电信两大运营商相互限制对方的访问速度,让很多的网通用户打开电信的服务器慢,电信的用户访问网通的服务器也慢。
让用户自己选择不是很好的,很多用户觉得会很麻烦。那么如何像:Http://www.hidotnet.com/ 一样自动的分配最快的服务器给用户呢?
演示地址:http://www.maxer.cn/autourl.htm
请看如下代码:
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<title>正在选择速度最快的镜像站点...</title></head>
<body>
<center><br><p> </p><p> </p>
<p><font color=red size=4><br><br></font><font color=red size=2>请稍候,正在分配最快的镜像给您登陆...</p>
</font>
<font color=red size=4>
<script>
i=1
var autourl=new Array()
autourl[1]="http://1.com"
autourl[2]="http://2.com"
autourl[3]="http://3.com"
autourl[4]="http://4.com"
autourl[5]="http://5.com"

function choose(url)
{
  if(i){top.location=url;i=0}
}
function run()
{
  for(var i=1;i<autourl.length;i++)
  document.write("<img src="+autourl[i]+" width=1 height=1 onerror=choose('"+autourl[i]+"')>")
}
run()
</script>
</font>
</body> [导入]如何分配最快的镜像服务器连接

This weblog is Power by Maxer.CN(刘翔).
文章来源:http://www.maxer.cn/blog/PermaLink,guid,2eb51966-c7b8-473a-a2e1-83275673ba27.aspx

相关文章:

  • 2021-07-07
  • 2021-07-30
  • 2021-04-04
  • 2022-01-16
  • 2021-06-08
  • 2021-05-17
  • 2021-12-15
  • 2021-12-15
猜你喜欢
  • 2021-06-15
  • 2021-07-29
  • 2021-09-30
  • 2022-02-01
  • 2022-12-23
  • 2021-07-30
相关资源
相似解决方案