Sunday, May 07, 2006

DOM Issues

For HW3 I was planning on writing a JavaScript thingy that would display a calendar on a page. The calendar would be generated from reading the date from the computer and spitting out the appropriate numbers in their right place (i.e. if the first day of the month is a Tuesday, the calendar table would have "1" printed in the first row, third column). The table would be created using JavaScript and HTML DOM. I got it down to the point where I only needed to print the numbers in the table cells, which I planned on doing using 2 for loops. Unfortunately, I discovered that you can't write variables as output to the cells. K.O. desu~ :(

So I'm wondering if there actually is a way to do what I wanted to do, or should I have just taken another route entirely...

1 Comments:

Blogger Richard Lee said...

Don't trip. I tried your approach and it seems to work just fine. Did you use document.getElementById? Here's my quick, unpretty hack version:

http://ieng9.ucsd.edu/~rtl001/calendar.html

I used an embedded script, so you can view the source. This is the second javascript program I've ever written, so please excuse the poor coding style.

btw, watashi wa purofiru no shashin ga suki desu. Looks just like you ;-]

2:15 AM  

Post a Comment

<< Home