I could not find any of this event to determine if it was just a change in binding, so I had to track it myself using code, for example:
function getLocation() { return location.pathname + location.search; } var currentLocation = getLocation(); $(function() { $(window).on("popstate", function() { var newLocation = getLocation(); if(newLocation != currentLocation) {
The place is stored without a hash, so when popstate is triggered by clicking the link to the binding, the getLocation method returns the same result as before, and there will be no code to replace the page.
To make sure that you are tracking the current location correctly, you also need to update the variable when you change state using pushState () or replaceState ()
source share