html自动随机跳转网址,网页随机跳转代码
生活随笔
收集整理的這篇文章主要介紹了
html自动随机跳转网址,网页随机跳转代码
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
網(wǎng)頁隨機跳轉代碼
zkx???2021 年 05 月 31 日
Loading...
```shell
網(wǎng)頁隨機跳轉var theAds = new Array(
"http://a.com",
"http://a.com",
"http://a.com",
"http://a.com",
"http://a.com"
);
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];
}
```
總結
以上是生活随笔為你收集整理的html自动随机跳转网址,网页随机跳转代码的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 关联矩阵古林法的matlab代码,[转载
- 下一篇: php重写地址,php url地址重写