title: HTML5 history disabling forward button
body: <p>I am writing a single page javascript application using the HTML5 History API. The application loads content via Ajax and internally maintains state information on the foreground screen using a screen stack.</p>
  
  <p><strong>I want to enable navigation with the back button, but I never want to the forward button to be enabled.</strong></p>
  
  <p>A couple quick bits of information:</p>
  
  <ul>
  <li>The user should only ever be able to go back, never forward</li>
  <li>Pressing browser back button closes the current page screen user is on and reloads the previous one</li>
  <li>Project is targeted towards the latest version of Chrome only, so other browsers implementations are not important</li>
  <li>I am using native JavaScript and jQuery only, I would like to do this without History.js</li>
  </ul>
  
  <p>When I load a new screen I run the following line:</p>
  
  <pre><code>history.pushState(screenData, window.document.title, "#");
  </code></pre>
  
  <p>I bind to the popstate event via jQuery:</p>
  
  <pre><code>$(window).bind("popstate", function(event) {
      if (event.originalEvent.state != null) {
          // Logic that loads the previous screen using my screen stack
      }
  }); 
  </code></pre>
  
  <p>My application's history management is working, however when I go back the forward button is enabled. I need to figure out how to remove data from <code>history</code> on the <code>popstate</code> event.</p>
  
  <p>Can I do this with replaceState? I'm not sure how to go about doing this...</p>