87,991
社区成员
发帖
与我相关
我的任务
分享
<script language="javascript">
function test(){
var url=new Array();
url[0]="http://www.baidu.com";
url[1]="http://www.csdn.net";
url[2]="http://bbs.voc.com.cn";
var ints=parseInt(Math.random()*(url.length));
window.open(url[ints]);//本窗口打开
//window.location=url[ints];//新窗口打开
}
</script>
<a href="javascript:test()">test</a>
<a href="#" onclick="this.href=parseInt(Math.random()*5+1)+'.html'">随机网页</a>