Hi!
Problem: I have a website with a large feed, people click links to my articles, being directed to them. When they click back, to return to the feed, i want the website to be refreshed, which i currently achieve with this custom code in the header:
<script>
(function () {
window.onpageshow = function(event) {
if (event.persisted) {
window.location.reload();
}
};
})();
</script>
It reloads the website whenever someone uses the back button in the browser, which is just what i want. The problem is: i would like the scroll position of the website to be kept as well, so my readers don’t have to scroll down again, after returning to the feed.
This issue is especially prevalent on the safari browser, which most iPhone users use, which in turn is most of my readership.
I’d be delighted if anyone of you has any suggestions to fix this issue!
c getty