ITperson

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
<script>
var srcArray = [1,2,3,4,5,6,7,];
if (!Array.prototype.shuffle) {
    Array.prototype.shuffle = function() {
        for(var j, x, i = this.length; i; j = parseInt(Math.random() * i), x = this[--i], this[i] = this[j], this[j] = x);
        return this;
    };
srcArray.shuffle();

</script>


 

posted on 2013-04-20 13:27  ITperson  阅读(149)  评论(0编辑  收藏  举报