虾米转帖随机音乐

<script type="text/javascript">
    var sid=new Array(1773257370,381546,1773228254,3450523,2051498,374744,1772118451,382446,385041,375918,73358,394329,1771659687,35026,1771933137,1769667723,1769274783,2568233,1771638197,1772274047,1769154074,3320101,142309,108902,3853,1769966152,1769019781,3294902,1813291,2118493,1770005054,1770005054,59457,22143,93357,1771829246,2113248,156254,1769176495,1772340707,3381912,375043,41303)
    var number = Math.floor(Math.random()*sid.length)
    var surl="http://www.xiami.com/widget/player-single?uid=35737588&sid="+sid[number]+"&mode=js"
    var srcjs='\<script type="text/javascript" src='+surl+'\>\</script\>'
    document.write('<p align="center">'+srcjs+'</p>')
</script>

虾米音乐能开放些API就更好了。。。

参考:

  1. JavaScript random方法得到随机整数
  2. 求救script src 后面怎么传递参数!!!
  3. JavaScript length 属性