xmlhttprequest calendar

Update: This is a very old entry. The project has a new home at jonabad.com.

Okay! Here’s a trick.

I was reading about xmlhttprequest and xml-rpc recently, and it got me all fired up – full of bright ideas.

Here’s my first practical use – the calendar on this site now uses an xmlhttprequest method to determine what posts appear on what date – give it a try – go back a few months using the calendar.

All you need to do is extract these files to your /wp-includes/ directory, then stick the following line in your template:

 <script src="/wp-includes/kcalendar.js" type="text/javascript"></script>

That’s it! *

And, in the interest of accessibility, when JavaScript is not enabled, the original calendar appears.

The current script works in Firefox, but probably not IE. If you want it to also work in IE, then load up this library as well as my one – it makes up for some of IE’s inadequacies.

update – 2004-11-10 – I linked to the xmlhttprequest script to give it IE compatibility. As far as I know, though, a creative commons license can’t be used for commercial purposes, though – so if you use this script for your work, then you’ll have to write your own IE compatibility layer.
update – 2004-11-11 – I just noticed that Dean Edwards’ IE compatibility layer has been updated with a new xml objects module which can emulate Mozilla’s xmlhttprequest functionality.
update – 2004-12-21 – the script was designed to work with a fairly fresh CVS install of wordpress. If you have edited your template at all, make sure that the calendar is contained in an element which has id="calendar" to identify it.
update – 2005-07-14 – noticed this page is still getting a few hits. Please go here to get the most recent work on this project.

12 Replies to “xmlhttprequest calendar”

  1. Very cool use of this technology! Remember that basic page I showed you earlier? I have it grabbing quote data from our db, it prints a nice flashing red * while it updates and prints changed elements of the table in red too. Dead chuffed with it altogether!

  2. I’ve been contemplating the use of xmlHttpRequest for a while, browser compatibility has been the only issue thats been keeping be back, but looking at this mini-app / plug-in I say “I’m going in …”. Finally I get to do away with those shoddy javascript calendars 🙂
    I’m going to use this tech for my CMS and eComm solutions. About time I started working on a paradigm.

  3. Hey, glad to see your calendar widget too! It’s a pretty nifty idea, and about a billion times better than all those calendars that require you to refresh the whole page (I never use those because I hate the refresh time). I wonder what else will be done with this amazing bit of technology…

  4. Thanks for this. I was searching everywhere for something which did this for my CMS. I was wondering though, if you have updated this lately?

Comments are closed.