title: How to reload page when back is pressed, after a pushState?
body: <p>Im currently using Code Igniter to have pretty URLs, and I have this system that basically uses ajax to allow you to search for gyms.</p>
  
  <p>Im using push state after a list of gyms is loaded, like this:</p>
  
  <p>example.com/list/search_key/pagination-page/sort-by/filters~seperated~by~that</p>
  
  <p>Where search_key is the city, state, or neighborhood in the area they want to search gyms, and filters are individual checkboxes.</p>
  
  <p>What happens, is I use .ajax to send the search key and each individual checkbox value (either 1 or 0) through post, then code igniter uses the POST data and PHP, to generate a url like the one above. The ajax success push states the URL to be the one the PHP generated.</p>
  
  <p>The problem is, that if you use say pagination to go to page-2, and you want to go to page-1, naturally youre going to use the browsers back button. The problem is, that it only backs the URL address bar to the url before hte current one, it doesnt actually change the pages content. I need it to either reload the page using the old (previous) url, or refresh, or something. </p>
  
  <p>I can even use ajax to resubmit the form using the URL data, but I have no clue how to do this.</p>
  
  <p>I have tried a few things, but nothing works at all. Pretty much I've tried everything on the first page of google, and everything seems promising but nothing actually works.</p>
  
  <p>Is there anyway to refresh the page, if a pushstate url changes to a previous url?</p>
  
  <p>PS Heres some of the key things Ive tried:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(window).unload(function(e){
     e.preventDefault();
     alert("Back was pressed!");
  });
  // If this wouldve worked, it wouldve atleast alerted me that.
  
  // The code off this URL: http://www.mrc-productivity.com/techblog/?p=1235
  
  // Some of the codes off this URL: http://forum.jquery.com/topic/howto-force-page-reload-refresh-of-previous-page-when-back-button-is-pressed
  
  // A few others.
  &lt;/script&gt;
  </code></pre>