Related Posts Widget for Blogs by LinkWithin

Wednesday, 16 April 2008

HTML: A bit of JavaScript

This is the script I have used to make my “To do” list which changes according to the day of the week:

<script language="JavaScript">

<!--

var ar = new Array(

"<b>Sunday</b><br>Worship God<br>Rest<br>",

"<b>Monday</b><br>make bread<br>make buttermilk<br>",

"<b>Tuesday</b><br>Bake bread<br>make spicy fruit loaf<br>",

"<b>Wednesday</b><br>bake spicy fruit loaf<br>plan menu for next week<br>make buttermilk<br>start yoghurt<br>",

"<b>Thursday</b><br>put yoghurt in fridge<br>start cream cheese<br>",

"<b>Friday</b><br>grind wheat<br><br>re-strain whey<br>transfer cream cheese from strainer<br>",

"<b>Saturday</b><br>Family Activity<br>"

);

var now = new Date();

var num = now.getDay();

num %= ar.length;

document.write(ar[num]);

// -->

</script>

Each day it displays what I have entered between the quotation
marks for that particular day so for example for Wednesday I have entered:

<b>Wednesday</b><br>bake spicy fruit
loaf<br>plan menu for next week<br>make buttermilk<br>start
yoghurt<br>

Which comes out as:

Wednesday
bake spicy fruit loaf
plan menu for next week
make buttermilk
start yoghurt

You could enter whatever you liked for each day such as writing, pictures or links as long as you remember to use HTML code to format what you put in.

1 comments:

Anonymous said...

Thanks I have been waiting on this. I will fiddle with this weekend.

Post a Comment

"For there is not a word in my tongue, but, lo, O LORD, thou knowest it altogether." ~ Psalm 139:4

Comments are now moderated due to spammers. If you wish to make a private comment or you would like to leave a comment but are unable to do so, please feel free to use my contact form near the top right of my blog.

  © Blogger template ProBlogger Template by Ourblogtemplates.com 2008

Back to TOP