Hasher icon indicating copy to clipboard operation
Hasher copied to clipboard

Can't go back after use the replaceState

Open Smolky opened this issue 10 years ago • 3 comments

Hi. I think there is a conflict with hasherjs and window.replaceState

This is my code:

hasher.setHash ('list');   // http://www.myexample.com/#list
hasher.setHash ('detail'); // http://www.myexample.com/#detail
window.history.replaceState ('', '', 'nice-url-to-allow-copy-paste.html#detail'); // http://www.myexample.com/nice-url-to-allow-copy-paste.html#detail

Everything goes fine until I press the back button on the browser (Chrome) and the parseHash function is not called again

(The parseHash function is the one of the examples)

function parseHash (newHash, oldHash) {
    ...
}

It's binded this way hasher.changed.add (parseHash); hasher.initialized.add (parseHash);

Thanks!

Smolky avatar Feb 26 '15 08:02 Smolky

which browser are you using?

millermedeiros avatar Feb 26 '15 13:02 millermedeiros

maybe this is related to #48 ?

millermedeiros avatar Feb 26 '15 13:02 millermedeiros

Hi. The browser is: Google Chrome Versión 40.0.2214.115 m

I'll check #48 as soon as I can to see if I can provide useful information. Thanks again and good work

Smolky avatar Feb 26 '15 14:02 Smolky