I'm working on this site: http://calebg.me/
To reproduce the issue, click a few links: Projects, Research, Resume, Contact
window.history.length
should be 5
.
Pressing the back button will load "/resume.html" as expected. window.history.length
is still 5
..
Pressing back again will reload "/resume.html". window.history.length
is still 5
...
Pressing back one last time will finally properly load "/research.html" as expected. window.history.length
is now 4
.
If you continue to press back all the way to the home page, you'll notice that all of the history entries appear to "pop" only after pressing back twice.
Has someone else encountered this that can spot what I've done wrong? You'll find the relevant code inside of the template.js file:
window.onpopstate = function(event) {
LoadURL(document.location.pathname);
}
I'm almost sure I just need to be using a return true
inside that callback or something silly. :P