title: Window.onpopstate it's activated with all href links
body: <p>I'm implementing a pagination using jQuery ajax but manipulating the history of the browser, and works fine so far but I realized a few hours ago that if I have a link in any part of my page:</p>
  <pre><code>&lt;a href=&quot;#&quot;&gt;My link&lt;/a&gt;
  </code></pre>
  <p>And make a click on this link, the function <code>window.onpopstate</code> is called but I don't know why, and this happens with all A HREF of my website.</p>
  <p>This is my function, detecting the current state to call to specific functions and load data by country or search term or the parameter of the URL specified.</p>
  <pre><code>window.onpopstate = function(event) {
      console.log(event);
      var section = $('#wrapper section').attr('id');
  
      if(event &amp;&amp; event.state) {
  
          
          //State for Reviews pagination ?page=x
          if (event.state.type == 'pagination') {
              popStateShopPage(event.state);
          }
  
          //State for Reviews pagination by country ?country=MX&amp;page=x
          if (event.state.type == 'country') {
              popStateShopPageCountry(event.state);
          }
  
          //State for Reviews pagination by search ?search=hello&amp;page=x
          if (event.state.type == 'search') {
              popStateShopPageSearch(event.state);
          }
          
      } else {
  
          if (section == 'shop-page') {
              popStateShopPage(1);
          }
  
          history.pushState(null);
      }
  }
  </code></pre>
  <p>And I'm using these functions to push the state:</p>
  <pre><code>history.pushState({type: 'pagination', page: number_page}, &quot;&quot;, &quot;?page=&quot;+number_page);
  history.pushState({type: 'country', page: number_page, country: country}, &quot;&quot;, &quot;?country=&quot;+country+&quot;&amp;page=&quot;+number_page);
  history.pushState({type: 'search', page: number_page, term: term}, &quot;&quot;, &quot;?search=&quot;+term+&quot;&amp;page=&quot;+number_page);
  </code></pre>