I got the same problem and the situation was pretty similar: no bookmark or parameters changed on the url.
Here is my solution and it works:
1) You can use window.history.go(-1)
or window.history.back()
, which is the same as back button on the browser, to navigate to previous page.
2) When you use this function, for some reason it might not be back to the position on your last page (eg. you select a picture on the bottom of page and it redirects to next page. When you click 'back' button, it goes back to the top of the previous page). In this case, you need to set the current scrollY value var currentScrollYonSession = window.scrollY
on the session or other place, depending on your code, when the app redirects to the next page (normally it's onClick()
or onChange()
event). When you click the 'back' button and the app loads the previous page, firstly check the session that the scrollY value is null or not. If it's null, just load the page as it is; otherwise, retrieve the scrollY value, load the page and set the scrollY value to the current page: window.scroll(0, currentScrollYonSession)
.