title: How to cancel a pjax event?
body: <p>I am using pjax in this way (from <a href="https://github.com/defunkt/jquery-pjax" rel="nofollow">https://github.com/defunkt/jquery-pjax</a>):</p>
  
  <blockquote>
    <p>Two. Slightly obtrusive, passing a container and binding an error
    handler:</p>
  </blockquote>
  
  <pre><code>&lt;a href='/explore' class='js-pjax'&gt;Explore&lt;/a&gt;
  
  $('#main').pjax('.js-pjax').on('pjax:error', function(e, xhr, err) {
    $('.error').text('Something went wrong: ' + err)
  })
  </code></pre>
  
  <p>In some cases, my link may have a class that should prevent the link from going through <code>&lt;a href='/explore' class='js-pjax no-link'&gt;Explore&lt;/a&gt;</code></p>
  
  <p>And the code to stop it:</p>
  
  <pre><code>$('body').on('click', 'a.no-link', function() {
      return false;
  });
  </code></pre>
  
  <p>My problem is: in this scenario, return false/preventDefault does not stop the pjax from firing.</p>
  
  <p>Any suggestions how to stop the pjax if the 'js-pjax' link also hasClass('no-link')?</p>