title: Load javascript file every time a new page is loaded
body: <p>I'm using <a href="http://instantclick.io" rel="nofollow">http://instantclick.io</a> on my website (a <code>pjax</code> jquery plugin) and I'm experiencing some problems regarding javascripts. It's very temperamental - sometimes a page will load with all the scripting working fine, but other times parts of the scripts will not run. Also, scripts are running more than once. For example, if I set a console log in a <code>.click()</code> function, I'll see the console log multiple times when there should only be one.</p>
  
  <p>In the instantclick.io documentation, it explains how to load a script on each page load:</p>
  
  <blockquote>
    <p>If you have a snippet of JavaScript that you need to execute on every page change, use the following:
             <code>InstantClick.on('change', yourCallback);</code></p>
  </blockquote>
  
  <p>But I need to run a whole js file rather than just a function. I have tried wrapping <code>InstantClick.on('change', function(){</code> around my whole js file, but the scripts are still not running again after a new page is opened.</p>
  
  <p>In my console, I'm seeing lots of errors relating to functions being undefined, which would indicate that the files are not being loaded each time.</p>
  
  <p>How would I solve this? Thanks!</p>