0

I have a webpage where one of your pages has a button that has to redirect to a different page according to the page that has been redirected.

Is there a way for the redirected page to know which page has caused the redirect with javascript or html?

Thank you!

Javi Palacios
  • 121
  • 3
  • 10

1 Answers1

0

Mozgovoy Artem is right.

var myReferrer = document.referrer;

will return the URI of the page that linked through to the current page.


More Info:

https://developer.mozilla.org/en-US/docs/Web/API/Document/referrer

Rounin
  • 27,134
  • 9
  • 83
  • 108