當前位置:編程學習大全網 - 網站源碼 - 隨機網頁跳轉代碼怎麽寫

隨機網頁跳轉代碼怎麽寫

Copyright ? 1999-2020, CSDN.NET, All Rights Reserved

登錄

李姝愛

關註

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];

}

  • 上一篇:mac下selenium2library裝在哪
  • 下一篇:怎麽從網站後臺上傳視頻
  • copyright 2024編程學習大全網