登錄
李姝愛
關註
html自動隨機跳轉網址,網頁隨機跳轉代碼 轉載
2021-06-02 15:26:24
李姝愛 ?
碼齡4年
關註
網頁隨機跳轉代碼
zkx ? 2021 年 05 月 31 日
Loading...
```shell
網頁隨機跳轉
var theAds = new Array(
"",
"",
"",
"",
""
);
shu = theAds.length ;
sx = parseInt(Math.random() * shu );
var tanurl = theAds[sx] ;
top.location.href = tanurl;
```
```shell
function dogo(){
var urls = new Array();
urls[0]="site1";
urls[1]="site2";
urls[2]="site3";
urls[3]="site4";
urls[4]="site5";
n = Math.floor(Math.random()* 5);
location.href= urls[n];
}