title: AJAX response using Jquery (with zend framework) contains unwanted HTML Code
body: <p>Currently, the following code works as intended but if I add an echo such as "LANG: en" anywhere in the code (let's say in the bootstrap), the following code won't work anymore and I get this ajax request response :</p>
  
  <pre><code>&lt;br/&gt;LANG : en{"response":true,"id":13}
  </code></pre>
  
  <p>(the ajax response contains the echo + json array ) and therefore I'm not able to print the id (it will print : undefined when i will try to access to data.id).</p>
  
  <p><strong>My question is : How can I print my debug info and still manage to perform ajax requests ?</strong></p>
  
  <p>Here is my code in the controller : </p>
  
  <pre><code>public function init()
  {
  $this-&gt;_helper-&gt;ajaxContext-&gt;addActionContext('retrievecategories', 'json')-&gt;initContext();
  }
  
  public function retrievecategoriesAction()
      {
          $this-&gt;_helper-&gt;layout()-&gt;disableLayout(); 
          $this-&gt;_helper-&gt;viewRenderer-&gt;setNoRender(true);
          if ($this-&gt;getRequest()-&gt;isXmlHttpRequest()) {
          if (isset($_POST['id']))
           $id = $_POST['id'];
          $id+=1;
          echo json_encode(array('response' =&gt; true, 'id' =&gt; $id));
          }
      }
  </code></pre>
  
  <p>My js code :</p>
  
  <pre><code>jQuery(function(){
  
  var obj = {"id":12};
  
  jQuery.ajax({
  url: '/search/retrievecategories?json',
  type: 'post',
  data: obj,
  dataType: 'json',
  success: function(data){
  var id = data.id;
  alert(id);
  },
  error: function(data){
  var id = data.id;
  alert(id);
  }
  });
  </code></pre>
  
  <p>});</p>
  
  <p>I hope I was clear enough. Thank you for your time !</p>