title: zend framework + jquery autocomplete remote not working
body: <p>I'm having a little trouble with JQuery autocomplete remote-cache and Zend,
  it doesn't work with the remote source, php remote source returns valid json data
  but it simply doesn't work, not even using the sample url for remote source:</p>
  
  <p><a href="http://jqueryui.com/demos/autocomplete/search.php?term=ga" rel="nofollow">http://jqueryui.com/demos/autocomplete/search.php?term=ga</a></p>
  
  <p>it only works with local json in the js file</p>
  
  <p>any help will be appreciated!</p>
  
  <p>(update) Code:</p>
  
  <p>`public function fetchpersonbyAction() {
          $this->_helper->viewRenderer->setNoRender(true);
          $this->_helper->layout->disableLayout();</p>
  
  <pre><code>    if(isset($_REQUEST['tokenValue']) &amp;&amp; !empty($_REQUEST['tokenValue'])) {
          $appPersons = new Application_Model_AppPersonsMapper();
          $foundPersons = $appPersons-&gt;fetchPersonBy(array('PERSONNAMES', 'PERSONSURNAMES'), '%b%');
  
          $pesonsData = array();
  
          foreach($foundPersons as $foundPerson) {
              $personLabel = ucwords(strtolower($foundPerson-&gt;PERSONNAMES)).' '.ucwords(strtolower($foundPerson-&gt;PERSONSURNAMES));
              $pesonsData[] = array('id' =&gt; $foundPerson-&gt;PERSONID, 'label' =&gt; $personLabel, 'value' =&gt; $personLabel);
          }
  
          echo header('Content-type: application/json');
          echo json_encode($pesonsData);
      }else {
          echo $this-&gt;jsRedirect;
      }
  }`
  </code></pre>
  
  <p>the code above is an action from the "persons" controller which return this:</p>
  
  <p>[{"id":1,"label":"Carlos Arturo Bucheli Padilla","value":"Carlos Arturo Bucheli Padilla"},{"id":2,"label":"Jhon Albert Doe Ramirez","value":"Jhon Albert Doe Ramirez"}]</p>
  
  <p>I'm using header('Content-type: application/json');
  The js code is:</p>
  
  <p>`$(function() {
          var availableTags = [{"id":1,"label":"Carlos Arturo Bucheli Padilla","value":"Carlos Arturo Bucheli Padilla"},{"id":2,"label":"Jhon Albert Doe Ramirez","value":"Jhon Albert Doe Ramirez"}];
          // var availableTags 'http://grupster.erp/persons-processor/fetchpersonby';</p>
  
  <pre><code>    $( "#tags" ).autocomplete({
          source: "http://jqueryui.com/demos/autocomplete/search.php",
          minLength: 2,
          select: function(event, ui) { alert(ui.item.id); }
      });
  });`
  </code></pre>
  
  <p>it works with a simple array in the js code but not with the remote source, i tried both jquery url and my own controller-action in my localhost</p>