Chris Mueller

Calendar Widget

January 11, 2005

Here's something for you sink your teeth into: a dynamic Javascript Calendar. On the home page of this site (a little bit down on the left side), I have built a calendar that provides chronological links to the posts on this web site.

The calendar uses the Javascript XMLHttpRequest object (this object lies at the heart of Google Suggest). When a new month is displayed on the calendar, a small request is made to a specialized PHP script that delivers an XML document containing information about all the posts for that month. Javascript XML parsing functions then inject the data into the calendar by editing the document's DOM.

You can look at the Javascript source code: calendar.js. Or glance at a sample XML document generated when a request is made by the XMLHttpRequest object.

Comments

Lauren writes:
On an unrelated note, ARE YOU ALIVE?! I never see you around campus and you're not online... Hopefully we catch up at some point!

Gary writes:
Hey Chris, good job being smart with computers.
Anyway, I like to use tabs in Firefox, but I can't open up pictures from you site in tabs. The window with the "next" button is fine, I just wondered why I can't use tabs! I like to open up like 10-30 tabs in each of 5-10 windows from different sites and then just plow through all of the content/reading in the next few hours/days.

Gary writes:
I also found this recently:
http://blogs.zdnet.com/Ou/index.php?p=22&tag=nl.e540-2
Interesting, but I wouldn't switch back.

chris writes:
Thanks for the link, Gary. It's good to know what the issues are. I think the Mozilla team is looking to support more of the quirky IE formatting as their product moves past v1.0.

And I'll look into that tab issue for you. The problem is that the links for images in the galleries are not standard links -- instead they call Javascript functions to open new pages. But there is probably a way for me to integrate what you are looking for.

Kae Verens writes:
Very interesting! Sometimes, memes prompt simultaneous creation. I, too, created an XMLHTTPRequest calendar. It uses almost the same method as yours. It is interesting to compare how the same project can be written by two completely separate programmers.

© cm