title: How to run jQuery before and after a pjax load?
body: <p>I'm currently using pjax and it works great but I need to run two jQuery functions, one before pjax loads the new url and one after the new url is loaded, how can I do this?</p>
  
  <p>I have tried the following two variations but neither seem to work?</p>
  
  <p>First attempt:</p>
  
  <pre><code>$("a").pjax("#main").live('click', function(){
  
      //Function Before Load  
      // Function After Load
  })  
  </code></pre>
  
  <p>Second attempt:</p>
  
  <pre><code>$("body").on("click", "a", function(){
  
      //Function Before Load  
  
      $(this).pjax("#main");
  
      //Function After Load   
  
      return false;
  });
  </code></pre>