JavaScript to implement music random broadcast code

Source: Internet
Author: User
Javascript| Random

Place the following code between

<script language= "JavaScript" >
<!--
var sound1= "Midi/1.mid"
var sound2= "Midi/2.mid"
var sound3= "Midi/3.mid"
var sound4= "Midi/4.mid"
var sound5= "Midi/5.mid"
var sound6= "Midi/6.mid"
var sound7= "Midi/7.mid"
var sound8= "Midi/8.mid"
var sound9= "Midi/9.mid"
var sound10= "Midi/10.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= "height=" "autostart=" true "loop=" True ">")
-->
</SCRIPT>



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.