Early this year I was talking to a friend of mine and he told me that he was working on an open source project called xajax. At the time I hadn’t really started to play with Ajax yet but the project sounded interesting so I filed it away in the back of my mind for future retrieval. Then in May my company sent me to The Ajax Experience in San Fransisco. That got me all excited about what could be done with Ajax. It also scared me because of the dificulties that people experience when using Ajax. So now one of my projects has got me using xajax.

As far as tools go, xajax seems to be a good one so far. It has many of the things that I want (unabtrusive, lightweight, extensible) without being overbearing.

So far I have stuck to a basic - edit table rows in place - implementation and even that has given me headaches. What I find is that most of the headaches are related to the poor error logging in the browsers or the incompatibility of the browsers. I started by using a link to call the javascript function like this <a href=”javascript:xajax_myFunction()”>click here</a>. That worked fine in IE but was giving me problems in Firefox. I chose to use a button instead of tracking down the problem (this is only a prototype) and got that working in Firefox but could not get it to work in IE. It turns out that you can set innerHTML in a <tr> tag in Firefox, but not in IE. So I moved things around and started setting the innerHTML in the <td> tags instead and then it stopped working in Firefox but started working in IE. Eventually I found that I had to move my <button> outside of the form in order to get it to work in Firefox. This whole time I am working with a new tool - xajax - and wondering if it is the tool or the browser. Well, I decided it was the browser and the tool worked as advertized.

If you are thinking about using Ajax in one of your projects, remember that it takes a lot of patience. If your project is in PHP then take a look at xajax. It doesn’t do everything Ajax for you, but it give a nice abstraction layer for the usual stuff.