xajax is an open source PHP class library that allows you to easily create powerful, web-based, Ajax applications using HTML, CSS, JavaScript, and PHP. (from http://xajax.sourceforge.net/)
It has a nice and straightforward implementation. It's still in alpha but that should be enough for most purposes.
So, here's a short howto for your own modules, f you like to implement some ajax stuff.
1. Download the class and place it into your module directory
2. Include it into your module file
require_once('inc/xajax.inc.php' );
3. Write the code
Your website should do something when the user clicks the button ;)
We just take the function 'my_function'.
// place this into your php code
function my_function() {
// code comes later
}
4. Register your functions
Place the following code into your [module_name]_menu() function ( What's this?)
// initialise xajax
$xajax = new xajax();
// register functions for ajax
$xajax->registerFunction("my_function");
// include javascript in html header
drupal_set_html_head($xajax->getJavascript());
// let xajax process ajax requests
$xajax->processRequests();
5. Write your javacript code
Wrong ;). We are not required to write any javascript code. Xajax is doing the dirty work for us.