Hi, From page A I click a link that redirects me to Page B.
On page B I click the browser back button and want to reload/refresh Page A.
At the moment I have this code in the JS editor of content template for Page A
window.onbeforeunload = function () {
window.scrollTo(0, 0);
}
I understand this code is for repositioning the page top left which actually what I need to do, but this code requires me to also click refresh on Page A, after clicking back button on Page B.
Thanks for any help
All you have to do is ask for assistance.
Googling a bit more I found:
// This prevents the page from scrolling down to where it was previously.
if ('scrollRestoration' in history) {
history.scrollRestoration = 'manual';
}
// This is needed if the user scrolls down during page load and you want to make sure the page is scrolled to the top once it's fully loaded. This has Cross-browser support.
window.scrollTo(0,0);
Works perfectly!
Thanks for your help