<script>
var song=new Array("http://colorweb.go.163.com/coco.wmv","http://colorweb.go.163.com/readyfor.wmv","http://colorweb.go.163.com/misgirl.wmv","http://colorweb.go.163.com/aparty.wmv","http://colorweb.go.163.com/alroundtheworld.wmv","http://colorweb.go.163.com/babybaby.wmv","http://colorweb.go.163.com/whodouthink.wmv","http://colorweb.go.163.com/wheretogo.wmv","http://colorweb.go.163.com/wannabe.wmv","http://colorweb.go.163.com/sayu.wmv","http://colorweb.go.163.com/rythemofnight.wmv","http://colorweb.go.163.com/meninblack.wmv","http://colorweb.go.163.com/macarina.wmv","http://colorweb.go.163.com/loveuway.wmv","http://colorweb.go.163.com/fun.wmv","http://colorweb.go.163.com/everybody","http://colorweb.go.163.com/badboy.wmv","http://colorweb.go.163.com/anothernight","http://colorweb.go.163.com/getulove.wmv");
var tmp='<EMBED SRC=' + song[Math.floor(Math.random()*song.length)] + ' WIDTH=0 HEIGHT=0 LOOP="true" AUTOSTART="true"></EMBED>'
document.write(tmp);
</script>

解决方案 »

  1.   

    <script>
    var song=new Array("coco.wmv","readyfor.wmv","misgirl.wmv","aparty.wmv","alroundtheworld.wmv","babybaby.wmv","whodouthink.wmv","wheretogo.wmv","wannabe.wmv","sayu.wmv","rythemofnight.wmv","meninblack.wmv","macarina.wmv","loveuway.wmv","fun.wmv","everybody","badboy.wmv","anothernight","getulove.wmv");
    var tmp='<EMBED SRC="http://colorweb.go.163.com/' + song[Math.floor(Math.random()*song.length)] + '" WIDTH=0 HEIGHT=0 LOOP="true" AUTOSTART="true"></EMBED>'
    document.write(tmp);
    </script>
      

  2.   

    <script>
    var song=new Array("coco.wmv","readyfor.wmv","misgirl.wmv","aparty.wmv","alroundtheworld.wmv","babybaby.wmv","whodouthink.wmv","wheretogo.wmv","wannabe.wmv","sayu.wmv","rythemofnight.wmv","meninblack.wmv","macarina.wmv","loveuway.wmv","fun.wmv","everybody","badboy.wmv","anothernight","getulove.wmv");
    var tmp='<EMBED SRC="http://colorweb.go.163.com/' + song[Math.floor(Math.random()*song.length)] + '" WIDTH=0 HEIGHT=0 LOOP="true" AUTOSTART="true"></EMBED>'
    document.write(tmp);
    </script>
      

  3.   

    <html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <title>每次都不一样的背景音乐</title>
    </head><body><SCRIPT language="JavaScript">
    <!--
    var sound1="song1.mid"
    var sound2="song2.mid"
    var sound3="song3.mid"
    var sound4="song4.mid"
    var sound5="song5.mid"
    var sound6="song6.mid"
    var sound7="song7.mid"
    var sound8="song8.mid"
    var sound9="song9.mid"
    var sound10="song10.mid"
    var x=Math.round(Math.random()*9)
    if (x==0) x=sound1
    else if (x==1) x=sound2
    else if (x==2) x=sound3
    else if (x==3) x=sound4
    else if (x==4) x=sound5
    else if (x==5) x=sound6
    else if (x==6) x=sound7
    else if (x==7) x=sound8
    else if (x==8) x=sound9
    else x=sound10
    if (navigator.appName=="Microsoft Internet Explorer")
    document.write('<bgsound src='+'"'+x+'"'+' loop="infinite">')
    else 
    document.write('<embed src='+'"'+x+'"'+'hidden="true" border="0" width="20" height="20" autostart="true" loop="true">')
    //-->
    </SCRIPT>
    </body></html>
      

  4.   

    不好意思
    我的意思是想打开一张网页(如下)在插件中载入*.asx(中有10个*.wmv文件)里面的歌曲是随机的,,而且还要一首一首连下去而不是单独重复一首个曲
    请问要怎么做/
    <html>
    <head>
    <title>随机播放媒体文件</title>
    </head>
    <body bgcolor=#666666>                  <OBJECT id=MediaPlayer1 width=226 height=154 style="LEFT: 0px; TOP: 0px" classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95">
                              <PARAM NAME="AudioStream" VALUE="-1">
                              <PARAM NAME="AutoSize" VALUE="0">
                              <PARAM NAME="AutoStart" VALUE="1">
                              <PARAM NAME="AnimationAtStart" VALUE="-1">
                              <PARAM NAME="AllowScan" VALUE="-1">
                              <PARAM NAME="AllowChangeDisplaySize" VALUE="-1">
                              <PARAM NAME="AutoRewind" VALUE="-1">
                              <PARAM NAME="Balance" VALUE="0">
                              <PARAM NAME="BaseURL" VALUE="">
                              <PARAM NAME="BufferingTime" VALUE="5">
                              <PARAM NAME="CaptioningID" VALUE="">
                              <PARAM NAME="ClickToPlay" VALUE="-1">
                              <PARAM NAME="CursorType" VALUE="0">
                              <PARAM NAME="CurrentPosition" VALUE="-1">
                              <PARAM NAME="CurrentMarker" VALUE="0">
                              <PARAM NAME="DefaultFrame" VALUE="">
                              <PARAM NAME="DisplayBackColor" VALUE="0">
                              <PARAM NAME="DisplayForeColor" VALUE="16777215">
                              <PARAM NAME="DisplayMode" VALUE="0">
                              <PARAM NAME="DisplaySize" VALUE="0">
                              <PARAM NAME="Enabled" VALUE="-1">
                              <PARAM NAME="EnableContextMenu" VALUE="-1">
                              <PARAM NAME="EnablePositionControls" VALUE="-1">
                              <PARAM NAME="EnableFullScreenControls" VALUE="0">
                              <PARAM NAME="EnableTracker" VALUE="-1">
                              <PARAM NAME="Filename" VALUE="music.txt"> //就这个文件或用*.asx文件
                              <PARAM NAME="InvokeURLs" VALUE="-1">
                              <PARAM NAME="Language" VALUE="-1">
                              <PARAM NAME="Mute" VALUE="0">
                              <PARAM NAME="PlayCount" VALUE="0">
                              <PARAM NAME="PreviewMode" VALUE="0">
                              <PARAM NAME="Rate" VALUE="1">
                              <PARAM NAME="SAMILang" VALUE="">
                              <PARAM NAME="SAMIStyle" VALUE="">
                              <PARAM NAME="SAMIFileName" VALUE="">
                              <PARAM NAME="SelectionStart" VALUE="-1">
                              <PARAM NAME="SelectionEnd" VALUE="-1">
                              <PARAM NAME="SendOpenStateChangeEvents" VALUE="-1">
                              <PARAM NAME="SendWarningEvents" VALUE="-1">
                              <PARAM NAME="SendErrorEvents" VALUE="-1">
                              <PARAM NAME="SendKeyboardEvents" VALUE="0">
                              <PARAM NAME="SendMouseClickEvents" VALUE="0">
                              <PARAM NAME="SendMouseMoveEvents" VALUE="0">
                              <PARAM NAME="SendPlayStateChangeEvents" VALUE="-1">
                              <PARAM NAME="ShowCaptioning" VALUE="0">
                              <PARAM NAME="ShowControls" VALUE="0">
                              <PARAM NAME="ShowAudioControls" VALUE="-1">
                              <PARAM NAME="ShowDisplay" VALUE="0">
                              <PARAM NAME="ShowGotoBar" VALUE="0">
                              <PARAM NAME="ShowPositionControls" VALUE="-1">
                              <PARAM NAME="ShowStatusBar" VALUE="-1">
                              <PARAM NAME="ShowTracker" VALUE="-1">
                              <PARAM NAME="TransparentAtStart" VALUE="0">
                              <PARAM NAME="VideoBorderWidth" VALUE="0">
                              <PARAM NAME="VideoBorderColor" VALUE="0">
                              <PARAM NAME="VideoBorder3D" VALUE="0">
                              <PARAM NAME="Volume" VALUE="9640">
                              <PARAM NAME="WindowlessVideo" VALUE="0">
                            </OBJECT> 
                      <map name="FPMap1"> 
                        <area onclick="javascript:MediaPlayer1.DisplaySize=3" href="#a" shape="rect" coords="182, 6, 221, 18">
                        <area onclick="javascript:MediaPlayer1.stop()"  href="#a" shape="rect" coords="34, 8, 43, 16">
                        <area onclick="javascript:MediaPlayer1.pause()" href="#a" shape="rect" coords="22, 7, 30, 17">
                        <area onclick="javascript:MediaPlayer1.play()" href="#a" shape="rect" coords="8, 7, 18, 17">
                      </map><br>
                      <img border="0" src="po3.gif" usemap="#FPMap1" width="226" height="20"></body>
    </html>
      

  5.   

    这样啊?
    那我还想在问一个问题
    在上面的代码里默认是用MIDIA PLAYER6.几的播放器
    能不能让他用MIDIA PLAYER8.0的插件呢