I am changing the url depending upon an AJAX call.
window.history.pushState("", "", ''+newUrlWithParameters);
Also I have a popstate event written within my JS.
$(window).on('popstate', function(e) {
//... do this
});
As soon as The pushState is being called, the popstate is triggered. How to prevent this?
I had the same issue - solved it by adding
to the calling event's handler (they handle a click event on an HTML a element, and tracing through jquery the mouseevent seemed to want to trigger the popState).