In a recent application, they wanted to store the last url within a page (or area) the user visited.
This codepen shows how to do it:
- click on
Last Dogs Pageand then select
- then click
- Then if you click
Last Dogs Pageagain, the selection of
dog 1will remain.
It works by listening to when the url changes and checking if the url’s data includes
page: "dog". If it does, it saves that url.