位置:海鸟网 > IT > JavaScript >

用javascript实现随机跳转页面

碰到一个用javascript实现随机跳转页面实例,发布出来,共同研究下,或许有用哦。
请看下面的实例

<html>
<head>
<title>Please waiting...</title>
<script language="javascript">
<!--
function urlList(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z)
{
    this[0]=a;
    this[1]=b;
    this[2]=c;
    this[3]=d;
    this[4]=e;
 this[5]=f;
 this[6]=g;
 this[7]=h;
 this[8]=i;
 this[9]=j;
 this[10]=k;
 this[11]=l;
 this[12]=m;
 this[13]=n;
 this[14]=o;
 this[15]=p;
 this[16]=q;
 this[17]=r;
 this[18]=s;
 this[19]=t;
 this[20]=u;
 this[21]=v;
 this[22]=w;
 this[23]=x;
 this[24]=y;
 this[25]=z;
}
function selectPage(list)
{
    var today=new Date();
    var page=today.getSeconds()%5;
    window.open(list[page],"_self");
}
var choices=new urlList("","","","","","","","","","","","","","","","","","","","","","","","","","");
-->
</script>
</head>
<body onLoad="selectPage(choices)">
Please waiting...
</body>
</html>