Liquid, JavaScript, themes, sales channels
I am trying to create a button that will return the user back to the previous page that they came from. I have tried:
<a href="javascript:history.go(-1)">Click here to go back to previous page</a>
but for some reason it does not work.
Anyone have any ideas on how to get something like this working?
You could try putting your JS inside the onclick="" attribute instead of the href="" one.
Probably better to use a button in this case instead of an anchor:
<button onclick="history.go(-1)">Click here to back to previous page</button>
Where should I place the coding in Shopify? Thanks so much.
Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024Digital marketers and app developers have tracked activity in apps and websites for yea...
By Ollie Mar 13, 2024February was an exciting month with Shopify Editions, informative webinars, and more! F...
By JasonH Mar 7, 2024