4 ms·
You should look into using replacestate()[1] from History API[2] instead of changing the hash on each pixel change. This will remove the problem of not been abl
by einarlove 13y ago
You should look into using replacestate()[1] from History API[2] instead of changing the hash on each pixel change.
This will remove the problem of not been able to use the back-button to get to the previous page (instead of the previous pixel)
[1]: http://stackoverflow.com/questions/17507091/replacestate-vs-pushstate http://stackoverflow.com/questions/17507091/replacestate-vs-...
[2]: https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Manipulating_the_browser_history https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/M...
- TheZenPsycho 13y agoThanks for the advice. I use the backbutton as an undo stack. if you want to get back to where you were before then you can open pix.pe in a new tab I suppose. Also, i would note that the backbutton is not per pixel. Each pixel event is filtered through a debouncer, so it actually only updates the url if you are inactive for about 200ms.