0

I want to get url of previous page when some user has clicked browser back button and is redirected to previous page. jquery or rails

1 Answers1

0

Have a look to this StackOverflow answer.

I think you just have to use this jQuery code :

$("#backLink").click(function(event) {
    event.preventDefault();
    history.back(1);
});

where #backlink is the selector of your button.

Community
  • 1
  • 1
Lucas Willems
  • 6,673
  • 4
  • 28
  • 45