Help with Javascript

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • WenULiVeUdiE
    Force of Nature Staff
    • Jan 2004
    • 1982

    #1

    Help with Javascript

    I missed the lesson on Javascript today in Web Page design, and all I have is a copy of the code. I typed it up in notepad, yet I get just a blank screen in IE. It is just the Javascript that does not work.

    Here is the Java code:


    Code:
    <SCRIPT LANGUAGE = "JavaScript">
    
    
    <!--
    now = new Date();
    hour = now.getHours();
    if (hour > 6 && hour < 16) {
    document.bgColor = "#FFFFFF";
    document.fgColor = "#000000";
    document.write ("<CENTER><IMG HEIGHT = 150 WIDTH = 515 SRC = 'daytimepictureputhere.gif'>");
    document.write ("<P>It's school time and the new day is dawning. Are you prepared?</CENTER>");
    }
    else {
    document.bgColor = "#000000";
    document.fgColor = "#FFFFFF";
    document.write ("<CENTER><IMG HEIGHT = 150 width = 515 SRC = 'nighttimepictureputhere.jpg'>");
    document.write ("<P>The school day is done and all is at peace. See you tomorrow.
    </CENTER>");
    }
    // -->
    
    </SCRIPT>
    Edit- Even with the CODE tag, it doesnt want to display the code. gah!
    Last edited by WenULiVeUdiE; 04-29-2005, 05:54 PM.
    Hey, look at that! It's Santa!

  • personman

    #2
    You see that thing that looks like a number sign up in the posting options? Press it and you should be able to enter code like
    Code:
    this

    Comment

    • WenULiVeUdiE
      Force of Nature Staff
      • Jan 2004
      • 1982

      #3
      I figured out the problem. There was an extra space between an end center tag. Damn, this Javascript is finicky,
      Hey, look at that! It's Santa!

      Comment

      Working...