JavaScript打开页面后自动随机跳转页面代码

来源:岁月联盟 编辑:zhuzhu 时间:2009-06-23

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>www.joyrssmail.com</title>
<script language=javascript>
function randompage(){
var randomindex=Math.floor(Math.random()*3)+1;//如果你有四个页面就把3改成4,如果有5个,就把3改成5
top.location.replace('index'+randomindex+'.htm');
}
randompage()
</script>
</head>
<body onload="randompage()">
</body>
</html>