求文字随机显示HTML代码(要求支持10条以上文字显示的) 我找到能显示10条文字的代码,但是少啊~~~我有很多要显示的内容谢谢高手啦!~! <script language="JavaScript">
<!-- Hide
var a = Math.random() + ""
var rand1 = a.charAt(5)
quotes = new Array
quotes[1] = '123123'
quotes[2] = '12322222'
quotes[3] = '655555555555'
quotes[4] = '666666666'
quotes[5] = '7777777'
quotes[6] = '8888'
quotes[7] = '999'
quotes[8] = '0000'
quotes[9] = '222'
quotes[0] = '111'
var quote = quotes[rand1]
//-->
</script>
<script language="JavaScript">
<!-- Hide
document.write(quote)
// -->
</script>
这个只能随机从这10个里面显示,我需要10个以上~请大家帮忙啊~
<!-- Hide
var a = Math.random() + ""
var rand1 = a.charAt(5)
quotes = new Array
quotes[1] = '123123'
quotes[2] = '12322222'
quotes[3] = '655555555555'
quotes[4] = '666666666'
quotes[5] = '7777777'
quotes[6] = '8888'
quotes[7] = '999'
quotes[8] = '0000'
quotes[9] = '222'
quotes[0] = '111'
var quote = quotes[rand1]
//-->
</script>
<script language="JavaScript">
<!-- Hide
document.write(quote)
// -->
</script>
这个只能随机从这10个里面显示,我需要10个以上~请大家帮忙啊~
解决方案 »
- jquery无故失效,有什么原因?
- 鼠标移动到图片上显示另外一幅图需要怎么做?
- 求:div宽度固定,里面的文字内容比div长,当鼠标移上去时滚动显示后面的内容
- 真心求教如何用javascript做集合菜单,做出的效果就和左边的一样---一个“+”号,点一下后就展开很多的子菜单,有源代码的更好!
- insertRow多行后,点击事件传值问题立结
- nodejs+express+mongodb存储json问题
- 请问怎样用javascript给当前不知道具体文本框名的文本框附值?
- 关于在html中使用xml数据岛的性能问题(绝对有分!)
- TextBox,TextAREA如何通过客户端JavaScript获取/设置SelectStart,SelectLength等相关信息
- 一个cookie的奇怪怪问题
- js Json 取key的问题
- 一个页面两个不同类型的表单
quotes.push('123123');
quotes.push('12322222');
//...
var rand1 = Math.floor(quotes.length*Math.random());
var quote = quotes[rand1];
var 集合=字串.split('|');
var 长度=集合.length-1;
var 序号=Math.round(Math.random()*长度);
alert(序号+' : '+集合[序号]);