当前位置:编程学习 > JS >>

javascript 随机广告代码

<script language="JavaScript" type="text/javascript">
//随机广告代码
tips = new Array(4);
tips[0] = '<a href="http://www.zhaoxi.org/" target="_blank"><img src="http://www.zhaoxi.org/down/js/images/12498863530.jpg" border="0" /></a>';
tips[1] = '<a href="http://www.zhaoxi.org/" target="_blank"><img src="http://www.zhaoxi.org/down/js/images/12498863531.jpg" border="0" /></a>';
tips[2] = '<a href="http://www.zhaoxi.org/" target="_blank"><img src="http://www.zhaoxi.org/down/js/images/12498863532.jpg" border="0" /></a>';
tips[3] = '<a href="http://www.zhaoxi.org/" target="_blank"><img src="http://www.zhaoxi.org/down/js/images/12498863533.jpg" border="0" /></a>';

index = Math.floor(Math.random() * tips.length);
document.write(tips[index]);
</script>

<p>刷新下看看效果吧~</p>

<p>查找更多代码,请访问:<a href="http://www.zhaoxi.org" target="_blank">中国WEB第一站</a></p>

补充:网页制作,js教程 
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,