Hello everyone,
i am struggling with the popstate event in a repeater. What I am trying is to listen on the popstate event in case a user uses the implemented Back Button or the browser Back Button. But it seems that the popstate event is not being triggered.
I tried to use the popstate like this:
window.popstate = function(e) { alert('hello onpopstate'); }
and
window.onpopstate = function(e) { alert('hello onpopstate'); }
Both seem not to be affected by "history.back()" or browser-back. What I try to achieve is to set an Item into the localstorage as soon as the button(implemented / browser) is being clicked.
Why would you do this in a repeater? Even if it worked you'd fire the event for every record of the repeater.
Can't you just set data in local storage on page load?
My goal is to write something into the localstorage as soon as the "history.back()" is being called. Therefore i need to catch the browsers-"history.back()" aswell... Any idea on how I can catch the event?
Please, sign in to be able to submit a new answer.