1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Javascript not working

Discussion in 'Software Development' started by gotrootdude, Apr 13, 2004.

Thread Status:
Not open for further replies.
  1. gotrootdude

    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???
     
  2. mussavcom

    mussavcom

    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.
     
  3. gotrootdude

    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..
     
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 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/220148

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice