-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Description
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 use popstate
instead of statechange
.
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, the getState
returns the equivalent to -1 only, and sticks with that forever, which makes it kinda useless.
$(window).bind('popstate', function(e){
if (typeof e['originalEvent'] !== 'undefined') {
phery.view('#container').remote(History.getState(false, false).cleanUrl);
}
});
Metadata
Metadata
Assignees
Labels
No labels