title: Prevent page reloading continuously
body: <p>I'm using <code>window.history.pushState({)</code> inside a function. This works fine as expected. Below is a an example.</p>
  
  <pre><code>$('#go_btn').click(function(){
     if ($('.green')) {
          var newurl = "cutomurl.html";
          if(newurl!=window.location){
               window.history.pushState({path:newurl},'',newurl);
          }
          return false;
     }
  });
  </code></pre>
  
  <p>and I've also got the below code to be able to refresh the page when the <code>newurl</code> is being triggered by the <code>$('#go_btn')</code> button.</p>
  
  <pre><code>$(window).on('popstate', function(){ 
      location.reload(true); 
  });
  </code></pre>
  
  <p>On the desktop version I don't seem to have any issues. But when I try to load this page on my iPad it continuously keeps on reloading the page over an over again. So how do I stop the continuous reloading and make the page refresh only when <code>window.history.pushState({path:newurl},'',newurl);</code> is being triggered?</p>