خرید بک لینک
I am trying to get an audio player to play a different song depending on the day of the week. The player as coded will play the song Orange Blossom Special.mp3. The javascript works to the extent it will write the day of the week in the field "demo". What I want is to replace Sunday, Monday, ect. with the name of a song, like memories.mp3, and have it write that song name in the <param name="src" value="Orange_Blossom_Special.mp3">where Orange Blossom Special.mp3 is written. Thanks.

Code:

<body>
<p>Click the button to display todays day of the week.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
    var d = new Date();
//    var n = d.getDay()
        var n = 6;
    if (n == 0) {
            greeting = "Sunday";
}       
        else if (n == 1) {
            greeting = "Monday";
}       
        else if (n == 2) {
            greeting = "Tuesday";
}       
        else if (n == 3) {
            greeting = "Wednesday";
}       
        else if (n == 4) {
            greeting = "Thursday";
}       
        else if (n == 5) {
            greeting = "Friday";
}       
        else {
            greeting = "Saturday";
}
   
    document.getElementById("demo").ierHTML = greeting;
}
</script>
 
<object>
<param name="autostart" value="true">
<param name="src" value="Orange_Blossom_Special.mp3">
<param name="autoplay" value="true">
<param name="controller" value="true">
<embed src="Orange_Blossom_Special.mp3" controller="true" autoplay="true" autostart="True" type="audio/wav" />
</object>


</body>

برچسب: نویسنده: آیلین رضوانی تاريخ: سه شنبه 20 تير 1396 ساعت: 4:56

صفحه بندی