title: Avoid the display of default layout in AJAX request in CakePHP
body: <p>I want to show a test div when the event <code>onchange</code> of a select is triggered, but in result div total default layout is displayed. I just want <code>test.ctp</code> to appear in my result div.</p>
  
  <p>This is my code, please tell what is wrong here. I've a dropdown with <code>id="ProductCategoryId"</code> and a result <code>div</code> like:</p>
  
  <pre><code>&lt;div id="result"&gt;result html&lt;/div&gt;
  </code></pre>
  
  <p>This is the jQuery function:</p>
  
  <pre><code>$("#ProductCategoryId").change(
    function() {
      var catid = $(this).val();
      $.post('product/test', {id: catid},
      function(result) {
        $('#result').html(result);
      });
    }
  );
  </code></pre>
  
  <p>In my <code>product_controller</code>:</p>
  
  <pre><code>function test() {
    $this-&gt;autorender = false;
    $this-&gt;layout = 'ajax';
  }
  </code></pre>
  
  <p>and in <code>test.ctp</code> only test output is written.</p>