-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
statechange on pushState, make it differ from back/forward button #209
Comments
I think I have the same issue. It sounds like there's no way to pushState() without triggering a statechange, so if you only want statechange to be called for back/forward navigation, you'll have to hack around it by not calling the callback the first time it's pushed onto the stack. Does anyone else know if history.js addresses this use case more elegantly? |
I've run into the same problem when shifting to History.js for IE support, why History.pushState doesn't trigger a identifiably different statechange to browser buttons is odd. Indeed the work around I have in place is the same as jeff which is a pretty nasty, be nice to see a way of handling this in the event handler. |
the same problem here... [edit] |
that |
no for me it is working perfectly |
currently I decided to drop History.js and, using modernizr, check the browser support for history api natively, IE suckers can have a full page load |
Currently, im only using pushState to keep the history, since I'm loading my website content through AJAX. When I call
History.pushState
, statechange gets called, and call the same content twice. I'm using link event delegation on my website, and I'm having to use a 'hack' and usepopstate
instead ofstatechange
.In my code, only when the content changes I use
History.pushState()
, because I can't do the otherway around. Also, when going back two times using the back button, thegetState
returns the equivalent to -1 only, and sticks with that forever, which makes it kinda useless.The text was updated successfully, but these errors were encountered: