I have a page which displays a filter-style menu that users can click to display particular listing category. When they click a listing thumbnail it opens the full listing page. At the top of that page is a “Back” text link. I need that link to return to the exact filtered category of the previous page.
The filtered category URL is something like this:
/residential/#listing-category
On the “Back” text link of the full listing page, I’ve tried:
<a href="javascript:history.back()">Back</a>
and also tried:
<a href="javascript:history.go(-1)">Back</a>
However, those only return to
/residential instead of /residential/#listing-category
How do I get the Back link to return to the full URL (e.g. /residential/#listing-category)?
pixelaid is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.