title: Kohana 3 Check if ajax request
body: <p>I'm currently using this to check if the request is an ajax request:</p>
  
  <pre><code>if ( ! Request::$is_ajax || Request::instance() == $this-&gt;request)
  {
      exit;
  }
  </code></pre>
  
  <p>If I try to access the page directly it'll exit, but if I make an ajax request, it'll also exit. I also tried just:</p>
  
  <pre><code>if ( ! Request::$is_ajax)
  {
      exit;
  }
  </code></pre>
  
  <p>And vice versa, but the script still exits everytime. If I remove the check, the ajax works as normal. Any idea what could be wrong? Thanks.</p>