Day of the Week Image Displayer

Description: A script that displays a different image according to the day of the week (i.e.: one image for Monday, one image for Tuesday etc).
Example: (For the sake of simplicity, bullets are used).
Directions: Simply insert the below into the <body> of your page: Simply change the path of the images in "mondayimg", tuesdayimg" etc to your own.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-

<script>
<!--
var mondayimg="../m1.gif"
var tuesdayimg="../m2.gif"
var wednesdayimg="../m3.gif"
var thursdayimg="../m4.gif"
var fridayimg="../m5.gif"
var saturdayimg="../m6.gif"
var sundayimg="../m7.gif"
var mydate=new Date()
var today=mydate.getDay()
if (today==1)
document.write('<img src="'+mondayimg+'">')
else if (today==2)
document.write('<img src="'+tuesdayimg+'">')
else if (today==3)
document.write('<img src="'+wednesdayimg+'">')
else if (today==4)
document.write('<img src="'+thursdayimg+'">')
else if (today==5)
document.write('<img src="'+fridayimg+'">')
else if (today==6)
document.write('<img src="'+saturdayimg+'">')
else
document.write('<img src="'+sundayimg+'">')
//-->
</script>



javascript image dow javascript


Back To Top
© 1998 - 2024 psacake.com
Version 7.21 | Advertise on this site