Ajax function not returning any html I'm trying to develop an Ajax process in a Drupal Module. Here's the code :

function My_Module_menu() {
  $items = array();

  $items['route/to/ajax/%'] = array(
    'page callback' =&gt; '_MY_MODULE_processing',
    'page arguments' =&gt; array(3),
    'type'  =&gt; MENU_CALLBACK,
    'access arguments' =&gt; array('acces content'),
    'delivery callback' =&gt; '_MY_MODULE_listing'
  );

  return $items;
}

function _MY_MODULE_processing($region='110') {

  // Executing some operations to retrieve a list of NIDs
  // retrieving the nodes
  $nodes = node_load_multiple ($nidList);
  return ($nodes) ;
}
/**
 * Here is the templating part
 * @param unknown $nodes
 */
function _MY_MODULE_listing ($nodes){
  $build = array();
  $nodeList='';
  foreach ( $nodes as $node ) {
    $nodeList = $nodeList.'&lt;option value='.$node-&gt;nid.'&gt;'.$node-&gt;title.'&lt;/option&gt;';
  }
    $build['content'][]=array(
      '#prefix'=&gt;'',
      '#suffix'=&gt;'',
      '#markup'=&gt;$nodeList,
    );

  return ($nodeList);
}


I don't get any response with this. I've run debugging function and it goes inside every function. First _MY_MODULE_processing then _MY_MODULE_listing.

How can i return a correct response ?
Got it. I returned the answer with ajax_deliver :

function mij_add_aide_list_proposition($nodes){
    // Magic stuff goes here (construction of $nodeList)
    $build['content'][]=array(
      '#prefix'=&gt;'',
      '#suffix'=&gt;'',
      '#markup'=&gt;$nodeList,
    );

  //$test=drupal_render($build);
  ajax_deliver($build);
}


If someone finds another way, I'm open to any change !