I am trying to save the scroll position of a page, when we go from that page (a product list) to a product, and then back to the product list. The only scenario this scenario should occur is when going from prodlist to prod to prodlist (pressing back).
My first thought was to check the URL from history in javascript, but history.back is not read, it's only action.
you can use jquery and call Position method or. Offset method on the window. And get x and y from top and left. Then store the x, y into a localStorage. Localstorage is for HTML5 very easy. And when user back to old page, read x, y from. Localstorage Example : localStorage. SetItem(name , value); LocalStorage. GetItem(name );