页面导航: 首页网络编程JavaScript应用技巧 → 正文内容

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

发布:dxy 发布日期:2006-12-2 字体:[增加 减小] 类型:转载
本人经过测试非常好用
代码一:
在要跳转的页面上写上:
<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
大家测试看看是不是跳转到最快的服务器上!
浏览次数:载入中... 打印本文关闭本文返回首页

文章评论

共有 位脚本之家网友发表了评论我来说两句

同 类 文 章
最 近 更 新
热 点 排 行