当前位置: 首页 > 图文教程 > 网络编程 > Javascript > 线路分流自动跳转代码;希望对大家有用!

Javascript
form中限制文本字节数js代码
use jscript with List Proxy Server Information
use jscript List Installed Software
List Installed Software Features
List Information About the Binary Files Used by an Application
List the Codec Files on a Computer
List the UTC Time on a Computer
List Installed Hot Fixes
excel操作之Add Data to a Spreadsheet Cell
Add Formatted Data to a Spreadsheet
Apply an AutoFormat to an Excel Spreadsheet
JavaScript语法着色引擎(demo及打包文件下载)
类之Prototype.js学习
一款JavaScript压缩工具:X2JSCompactor
iis6+javascript Add an Extension File
jscript之Open an Excel Spreadsheet
jscript之Read an Excel Spreadsheet
jscript之List Excel Color Values
去除图像或链接黑眼圈的两种方法总结
Add a Formatted Table to a Word Document

Javascript 中的 线路分流自动跳转代码;希望对大家有用!


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-12   浏览: 192 ::
收藏到网摘: n/a

本人经过测试非常好用
代码一:
在要跳转的页面上写上:
<script language="JavaScript">
var m=50000;
var n=Math.floor(Math.random()*m+1)
//alert(n);
document.write("<iframe src=http://cnc.5nd.com/test.htm?"+n+"||"+location.search.replace(/\?/g,"")+" WIDTH=0 HEIGHT=0 MARGINHEIGHT=0 MARGINWIDTH=0 FRAMEBORDER=0 SCROLLING=NO></iframe>");
document.write("<iframe src=http://dx.5nd.com/test.htm?"+n+"||"+location.search.replace(/\?/g,"")+" WIDTH=0 HEIGHT=0 MARGINHEIGHT=0 MARGINWIDTH=0 FRAMEBORDER=0 SCROLLING=NO></iframe>");
document.write("<iframe src=http://www.5nd.com/test.htm?"+n+"||"+location.search.replace(/\?/g,"")+" WIDTH=0 HEIGHT=0 MARGINHEIGHT=0 MARGINWIDTH=0 FRAMEBORDER=0 SCROLLING=NO></iframe>");
</script>
--------------------------------------------------------------------------------------
test.htm页面代码:注意每个服务器站点都要放这个文件:
<script language="JavaScript">
/*
这里写上一写文字,不要太多150-200行就可以了,主要作用是,如果你的站点默认页面为DEFAULT。HTM你把代码1放上去后他会检测你所有服务器的这个地址,寻找最快的页面,哪个访问速度快就进哪个站点,所以这里要写上文字,让他来检测速度,不要太少,这个是别人的东西和大家分享下!
*/
if (top.location !== self.location) {
top.location=self.location;
}
var url1,url2;
url1=location.search.replace(/\?/g,"")
url2=url1.split("||");
location.href="index.htm";
</script>
站点演示:http://www.5nd.com
网通:http://cnc.5nd.com
大家测试看看是不是跳转到最快的服务器上!