當前位置:蘿卜系統下載站 > 技術開發教程 > 詳細頁面

自動打開最快鏡像站

自動打開最快鏡像站

更新時間:2019-04-27 文章作者:未知 信息來源:網絡 閱讀次數:


是不是有好幾個鏡像站點?是不是經常有的站點打不開?你是不是想讓網友自動進入一個最快的鏡像站點?相信這是困擾了許多個人網站站長的問題,現在終于有了個很好的解決辦法了...... 

方案一: 

<html> 
<head> 
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312"> 
<meta http-equiv="refresh" content="5;url=./"> //設定檢測的時間,每5秒刷新一次 
<title>自動選擇最快站點</title></head> 
<center> 
<p> 

 
<font color=blue size=7>
 
請稍候,正在選擇速度最快站點......</p> 
<script> 
i=1 
var autourl=new Array() 
autourl[1]="http://szyhbcn.y365.com"; 
autourl[2]="http://www.qxcomm.com/p_html/szyhbcn"; 
autourl[3]="http://free.yc365.com/szyhbcn"; //設置三個鏡像站點,當然你也可以多加幾個只要如上形式即可. 
function auto(url) //設置一個自動轉向的函數 

if(i) 

i=0; 
top.location=url //設置新頁面打開的形式 
}} 
function run() //設置一個啟動函數 

for(var i=1; 
i<autourl.length;i++) //設置一個循環檢測,檢測最先打開的站點 
document.write("<img src="+autourl+" width=1 height=1 onerror=auto('"+autourl+"')>") //寫出具體的鏈接地址 

run() //啟動函數 
</script> 
</body></html> 


方案二: 

直接將下面代碼加入到<body></body>中 

<script> 
i=1 

var autourl=new Array() 

autourl[1]="szyhbcn.y365.com" 

autourl[2]="www.qxcomm.com/p_html/szyhbcn" 

autourl[3]="free.yc365.com/szyhbcn" 

function auto(url){if(i){i=0;top.location=url}} 

function run(){for(var i=1;i<autourl.length;i++)document.write("<img src=http://"+autourl+" width=1 height=1 onerror=auto('http://"+autourl+"')>")} 

run() 
</script> 

溫馨提示:喜歡本站的話,請收藏一下本站!

本類教程下載

系統下載排行

網站地圖xml | 網站地圖html
亚洲嫩草影院久久精品