//add the client side js
function hook_init()
{
drupal_add_js(‘$(document).ready(
function(…){});
‘,’inline’);
}
//server side callback
function my()
{
drupal_set_header(‘Content-Type: text/plain; charset: utf-8′);
$output = ”;
…
echo json_encode($output);
}


