Here’s a simple, minimal implementation of AJAX in Drupal using jQuery.
First create a menu item callback.
Next create the callback function. To test the menu item and callback function, go to http://[YOURSITE]/ajax; you should get the text “wee!” without any theming.
Next create a page that has a button on it with an ID of “ajaxButton”. The following jQuery will add an onClick event to the button.