Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Day of the week script 1

Status
Not open for further replies.

mb31

Technical User
Nov 19, 2001
1
GB
Hi
I would like to setup a page to redirect to another page based upon the day of the week. For example if today is Monday , I want to redirect to monday.htm. I am a beginner and have tried the following, but it doesn't work. Thanks<script>
var mydate=new Date()
var today=mydate.getDay()
if (today==1)
window.location='monday.htm'
else if (today==2)
window.location='tuesday.htm'
else if (today==3)
window.location='wednesday.htm'
else if (today==4)
window.location='thursday.htm'
else if (today==5)
window.location='friday.htm'
else if (today==6)
window.location='saturday.htm'
else
window.location='sunday.htm'


//-->
</script

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top