Javascript not working

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

gotrootdude

Thread Starter
Joined
Feb 19, 2003
Messages
8,812
<script language="JavaScript">

s_date = new Date();

if(s_date.getDay() == 1){
document.write('<embed width=0 height=0 hidden="true" autostart="true" volume="5" loop="false" src="http://www.s95023664.onlinehome.us/musicstreams/Track-20.mp3">');
}


if(s_date.getDay() == 2){
document.write('<embed width=0 height=0 hidden="true" autostart="true" volume="5" loop="false" src="http://www.s95023664.onlinehome.us/musicstreams/Track-21.mp3">');
}


if(s_date.getDay() == 3){
document.write('<embed width=0 height=0 hidden="true" autostart="true" volume="5" loop="false" src="http://www.s95023664.onlinehome.us/musicstreams/Track-22.mp3">');
}


if(s_date.getDay() == 4){
document.write('<embed width=0 height=0 hidden="true" autostart="true" volume="5" loop="false" src="http://www.s95023664.onlinehome.us/musicstreams/Track-23.mp3">');
}


if(s_date.getDay() == 5){
document.write('<embed width=0 height=0 hidden="true" autostart="true" volume="5" loop="false" src="http://www.s95023664.onlinehome.us/musicstreams/Track-24.mp3">');
}


if(s_date.getDay() == 6){
document.write('<embed width=0 height=0 hidden="true" autostart="true" volume="5" loop="false" src="http://www.s95023664.onlinehome.us/musicstreams/Track-25.mp3">');
}


if(s_date.getDay() == 7){
document.write('<embed width=0 height=0 hidden="true" autostart="true" volume="5" loop="false" src="http://www.s95023664.onlinehome.us/musicstreams/Track-26.mp3">');
}


if(s_date.getDay() == 0){
document.write('<embed width=0 height=0 hidden="true" autostart="true" volume="5" loop="false" src="http://www.s95023664.onlinehome.us/musicstreams/Track-26.mp3">');
}

</script>

Why won't it work???
 
Joined
Mar 28, 2004
Messages
51
What about it doesn't work, exactly?

You do have 8 if statements, and there are only 7 days of the week...

Take out the one for day 7, because the days are numbered from 0 to 6, starting on Sunday and ending on Saturday.
 

gotrootdude

Thread Starter
Joined
Feb 19, 2003
Messages
8,812
Found the problem.. I couldn't include the script into the body and call a external .js file at the same time..
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Top