I\'m using the hash to load content dynamically. To make the back button work I am capturing hash changes. However sometimes I need to change the hash without triggering the has
You could use history.replaceState and append the hash, to replace the current URI without triggering the hashchange event:
history.replaceState
hashchange
var newHash = 'test'; history.replaceState(null, null, document.location.pathname + '#' + newHash);
JSFiddle example