JANUARY1 is not defined!?
I SERIOUSLY need help with this one. All I can get out of my computer is 'JANUARY1 is not defined.' Meaning:confused:?
Code:
var finddate = new Date();
var findmonth = finddate.getMonth();
var findday = finddate.getDate();
var holiday;
var exclaim;
var displayMonth;
var findyear = finddate.getYear();
switch (findmonth) {
case 0 :
displayMonth = "JANUARY"
break
case 1 :
displayMonth = "FEBRUARY"
break
case 2 :
displayMonth = "MARCH"
break
case 3 :
displayMonth = "APRIL"
break
case 4 :
displayMonth = "MAY"
break
case 5 :
displayMonth = "JUNE"
break
case 6 :
displayMonth = "JULY"
break
case 7 :
displayMonth = "AUGUST"
break
case 8 :
displayMonth = "SEPTEMBER"
break
case 9 :
displayMonth = "OCTOBER"
break
case 10 :
displayMonth = "NOVEMBER"
break
case 11 :
displayMonth = "DECEMBER"
break
default: displayMonth = "INVALID"
}
var findholiday = displayMonth + findday
switch (findholiday) {
case JANUARY1 :
holiday = "New Year's Day"
exclaim = "Happy " + findyear
break
case JANUARY15 :
holiday = "Martin Luther King, Jr.'s Birthday"
exclaim = "Feel the freedom"
break
case JANUARY27 :
holiday = "the Penguin Popcorn Parade"
exclaim = "Munch, munch, munch"
break
case FEBRUARY2 :
holiday = "Groundhog's Day"
exclaim = "Let's hope he'll wake up"
break
case FEBRUARY12 :
holiday = "Abraham Lincoln's Birthday"
exclaim = "Goodbye, slavery"
break
case FEBRUARY14 :
holiday = "Valentine's Day"
exclaim = "Feel the love"
break
case FEBRUARY15 :
holiday = "Petentine's Day"
exclaim = "Slurp, slurp, slurp"
break
case FEBRUARY22 :
holiday = "George Washington's Birthday"
exclaim = "Fly the flag"
break
case MARCH17 :
holiday = "St. Patrick's Day"
exclaim = "It's hard to find <i>any</i> clovers"
break
case APRIL1 :
holiday = "April Fool's Day"
exclaim = "My computer is laughing"
break
case APRIL10 :
holiday = "ASPCA's Birthday"
exclaim = "Woof, woof, woof"
break
case APRIL22 :
holiday = "Earth Day"
exclaim = "I think I use too many watts"
break
case JUNE14 :
holiday = "Flag Day"
exclaim = "Someone design an Antarctica flag"
break
case JULY4 :
holiday = "Independence Day"
exclaim = "Fireworks scare me"
break
case AUGUST29 :
holiday = "Henry Bergh's Birthday"
exclaim = "1813? Yikes"
break
case OCTOBER31 :
holiday = "Halloween"
exclaim = "Whooooooo"
break
case DECEMBER25 :
holiday = "Christmas"
exclaim = "Smell the gingerbread"
break
case DECEMBER31 :
holiday = "New Year's Eve"
exclaim = "Goodbye, " + findyear
break
default: holiday = displayMonth + " " + findday; exclaim = ""
}
document.write("It's " + holiday + "!<br><center><font class=exclamation>" + exclaim + "!</font></center></br>");
Nobody bother with <script language="JavaScript" type="text/javascript">. I did that already. I am positive that the book that taught me JavaScript said everything I did here was valid. YEAAAH, RIIIGHT!