title: Can I prevent history.popstate from triggering on initial page-load?
body: <p>I'm working on a site that serves content via AJAX.</p>
  
  <p>If you click an item in the menu, a content div gets updated with <code>$.get</code> response, nothing fancy.</p>
  
  <p>I'm implementing <code>history.pushState</code> to allow navigation with the browser's back/forward button.</p>
  
  <p>I have the following to load content on history navigation:</p>
  
  <pre><code>$(function() {
      $(window).bind("popstate", function() {
          $.getScript(location.href); 
      });
  });
  </code></pre>
  
  <p>The problem is, when a page is loaded for the first time, this function does <code>$.getScript</code> so the page is loaded immediately again. The first time the page is loaded it renders the initial HTML view, then on the second load it renders the JS view, since its a JS request.</p>
  
  <p>How could I prevent this event from firing on pages with HTML requests?</p>