'Ahah!', 'page callback' => 'drupal_get_form', 'page arguments' => array('poof_form'), 'access arguments' => array('access content') ); $items['poof/message_js'] = array( 'page callback' => 'poof_message_js', 'type' => MENU_CALLBACK, 'access arguments' => array('access content') ); return $items; } function poof_form() { $form['target'] = array( '#type' => 'markup', '#prefix' => '
Click me. I dare you.'
', ); $form['submit'] = array( '#type' => 'button', '#value' => t('Click Me'), '#ahah' => array( 'event' => 'click', 'path' => 'poof/message_js', 'wrapper' => 'target', 'effect' => 'fade', ) ); return $form; } function poof_message_js() { $output = t('POOF!'); drupal_json(array('status' => TRUE, 'data' => $output)); }