title: Drupal throwing ajax error 200 with autocomplete textfield?
body: <p>In this module I'm creating i'm implementing drupal's autocomplete and it's giving me this error. I can't figure out why.. </p>
  
  <pre><code>An AJAX HTTP error occurred.
  HTTP Result Code: 200
  Debugging information follows.
  Path: http://localhost/admin/content/searchcontent/autocomplete
  StatusText: OK
  ResponseText: 
  localhost
  @import url("http://localhost/modules/system/system.base.css?mm2qoh");
  @import url("http://localhost/modules/system/system.menus.css?mm2qoh");
  @import url("http://localhost/modules/system/system.messages.css?mm2qoh");
  @import url("http://localhost/modules/system/system.theme.css?mm2qoh");
  @import url("http://localhost/misc/ui/jquery.ui.core.css?mm2qoh");
  @import url("http://localhost/themes/seven/jquery.ui.theme.css?mm2qoh");
  @import url("http://localhost/misc/ui/jquery.ui.autocomplete.css?mm2qoh");
  @import url("http://localhost/modules/system/system.admin.css?mm2qoh");
  @import url("http://localhost/sites/all/modules/customheaderimage/css/customheaderimage_style.css?mm2qoh");
  @import url("http://localhost/sites/all/modules/customheaderimage/css/customheaderimage_admin_style.css?mm2qoh");
  @import url("http://localhost/sites/all/modules/custom/searchcontent/searchcontent.css?mm2qoh");
  @import url("http://localhost/modules/comment/comment.css?mm2qoh");
  @import url("http://localhost/modules/field/theme/field.css?mm2qoh");
  @import url("http://localhost/modules/node/node.css?mm2qoh");
  @import url("http://localhost/modules/search/search.css?mm2qoh");
  @import url("http://localhost/modules/user/user.css?mm2qoh");
  @import url("http://localhost/sites/all/modules/views/css/views.css?mm2qoh");
  @import url("http://localhost/sites/all/modules/coffee/css/coffee.css?mm2qoh");
  @import url("http://localhost/sites/all/modules/ctools/css/ctools.css?mm2qoh");
  @import url("http://localhost/modules/toolbar/toolbar.css?mm2qoh");
  @import url("http://localhost/modules/shortcut/shortcut.css?mm2qoh");
  @import url("http://localhost/themes/seven/reset.css?mm2qoh");
  @import url("http://localhost/themes/seven/style.css?mm2qoh");
  Skip to main content
  Home
  Hello jake
  Log out
  Administrative toolbarDashboard (View and customize your dashboard.)
  Content (Administer content and comments.)
  Structure (Administer blocks, content types, menus, etc.)
  Appearance (Select and configure your themes.)
  People (Manage user accounts, roles, and permissions.)
  Modules (Extend site functionality.)
  Configuration (Administer settings.)
  Reports (View reports, updates, and errors.)
  Help (Reference for usage, configuration, and modules.)
  Hide shortcuts      
  Add content
  Find content
  Edit shortcuts  
  You are hereHome            Add to Default shortcuts      
  Search by Title
  Show only items where
  status 
  anypublishednot publishedpromotednot promotedstickynot sticky
  type 
  anyArticleBasic page
  Update options
  Operation 
  Publish selected contentUnpublish selected contentPromote selected content to front pageDemote selected content from front pageMake selected content stickyMake selected content not stickyDelete selected contentUpdate URL alias
  TitleTypeAuthorStatusUpdatedOperations 
  Update Gloabl Background 
  Gloabl Background  newBasic pageadminpublished04/27/2013 - 22:21edit
  delete
  Update ComComp 
  ComComp  newBasic pageadminpublished04/27/2013 - 13:59edit
  delete
  Update Sidelining 
  Sidelining  newBasic pageadminpublished04/27/2013 - 12:27edit
  delete
  Update Zapper 
  Zapper  newBasic pageadminpublished04/27/2013 - 11:54edit
  delete
  Update About 
  About  newBasic pageadminpublished04/27/2013 - 11:49edit
  delete
  </code></pre>
  
  <p>It's just returning the page, not the json output..It does this in firefox and chrome that i've checked. Here is the rest of my code to implement it.</p>
  
  <pre><code>function searchcontent_menu() {
    $items['admin/content/searchcontent/autocomplete'] = array(
      'page_callback' =&gt; 'searchcontent_autocomplete',
      'access callback' =&gt; TRUE,
      'type' =&gt; MENU_CALLBACK,
    );
    return $items;
  }
  
  //This form code is in the form setup function
  $form['searchcontent_box']['searchcontent_search'] = array(
    '#type' =&gt; 'textfield',
    '#default_value' =&gt; $keywords,
    '#weight' =&gt; -10,
    '#size' =&gt; 38,
    '#autocomplete_path' =&gt; 'admin/content/searchcontent/autocomplete',
  );
  
  function searchcontent_autocomplete($string = '') {
    $items = array();
    $items['about'] = 'about';
    $items['contact'] = 'contact';
    drupal_json_output($items);
  }
  </code></pre>
  
  <p>I explicitly set the items for testing so that there was no issue with my query.
  Can anyone find the error that is causing this?</p>
  
  <p>Thanks.</p>