Coder’s Eye

A site about one of the three passions in my life.

Coder’s Eye header image 2

AJAX goodness for Invisible Castle

January 2nd, 2006 · 3 Comments

I just rolled my first real AJAX application out to testing. My Invisible Castle site is a die-roller for online gaming. It lets uses roll dice, and it lets their game masters or fellow players go look them up later. Fairly simple, but it got over 150,000 rolls last year alone.

I like to use the site as a testbed for new technologies that I’m interested in learning or exercising. This has worked out really well for me, leading me to the excellent Cheetah Template page template system for Python. Last fall, I completed a major refactoring of the site, and moved it to Dreamhost. With Cheetah in place, and the code all clean and lovely, I am now finding it very simple to add new features.

AJAX, why?

Despite it being a testbed, I don’t like to add features for the sake of features. That’s just silly. I could “ajax-up” the site, making it prettier I suppose. Maybe I’ll do that as I work on the site, but for my first AJAX app, I wanted something more interesting. So, I decided to open up the site to remote calls.

I want remote gaming sites to be able to embed a tiny amount of well-written Javascript, and end up with the ability to roll “in place” for their users. This morning, with the aid of Prototype and Behaviour libraries, I whipped out a nice remoting system in just a couple hours.

Cross-site

The most annoying part of the whole mini-app was enabling the cross-site AJAX call. I solved it by writing a quick PHP script which simply uses curl in the background to call my site, passing along the parameters. That script gets installed on the site which wants to use my roller, and bang, instant on.

It was fun to write. Take a look at the remote test here and let me know what you think. Notice, not a single line of ugly in-line javascript. Behaviour is a wonderful library!

Tags: Libraries · Open Source · AJAX · Javascript

Bookmark this article

del.icio.us:AJAX goodness for Invisible Castle digg:AJAX goodness for Invisible Castle spurl:AJAX goodness for Invisible Castle wists:AJAX goodness for Invisible Castle simpy:AJAX goodness for Invisible Castle newsvine:AJAX goodness for Invisible Castle blinklist:AJAX goodness for Invisible Castle furl:AJAX goodness for Invisible Castle reddit:AJAX goodness for Invisible Castle fark:AJAX goodness for Invisible Castle blogmarks:AJAX goodness for Invisible Castle Y!:AJAX goodness for Invisible Castle smarking:AJAX goodness for Invisible Castle magnolia:AJAX goodness for Invisible Castle segnalo:AJAX goodness for Invisible Castle gifttagging:AJAX goodness for Invisible Castle

3 responses so far ↓

Leave a Comment