1

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

Caleb Gray
  • 3,040
  • 2
  • 21
  • 32
  • I should mention that I'm using Chromium... and so if you're on a different browser and not experiencing this behavior, that would also be useful to know. ^_^ – Caleb Gray Jan 28 '13 at 01:33

1 Answers1

0

I was also having same issue, but it is resolved using this reference. Please try below link once,

For resolving popstate on page load

Community
  • 1
  • 1
KomalJariwala
  • 1,977
  • 3
  • 23
  • 32