Display bare HTML from hook_menu()
To show only the output of the callback, and not the complete page Drupal would render, output the HTML using print or echo; if you return the HTML output as string, Drupal will render the normal Drupal page, which includes the HTML your callback returns.

The code contained in index.php that causes this behavior is the following one:

// Menu status constants are integers; page content is a string.
if (is_int($return)) {
  switch ($return) {
    case MENU_NOT_FOUND:
      drupal_not_found();
      break;
    case MENU_ACCESS_DENIED:
      drupal_access_denied();
      break;
    case MENU_SITE_OFFLINE:
      drupal_site_offline();
      break;
  }
}
elseif (isset($return)) {
  // Print any value (including an empty string) except NULL or undefined:
  print theme('page', $return);
}


&nbsp;

drupal_set_header() is used from drupal_json() to change the content type of the output (the "Content-Type" metadata); normally Drupal will set it to "text/html" which is not appropriate for what returned from a callback returning JSON; in that case, the content type that allows the requester to handle the output correctly is "text/javascript."