0

I've been searching the internet for a while to find an answer, but have had no luck.

document.referrer in ie does not work.

I need to find the previous url without storing in local storage, cookies or setting sessions. Is there any way to do this?

I am not creating a back button or a link so window.history does not work in this situation. I need to perform an action to display an element based on where they previously were.

Any help is appreciated!

zazvorniki
  • 3,512
  • 21
  • 74
  • 122
  • @Helium_1s2, unfortunately not. That is creating a link for a back button. – zazvorniki Jul 10 '18 at 20:58
  • What does `document.referrer` returns in IE? – Ibu Jul 10 '18 at 20:59
  • @Ibu, it returns blank because ie doesn't return that header. From what I have been reading it is a known issue, but have found no solutions. i was hoping maybe someone had a trick :) – zazvorniki Jul 10 '18 at 21:00
  • You could encode it into the url itself, as described in this post: https://stackoverflow.com/questions/5847615/document-referrer-issue-on-ie-when-the-requests-doesnt-come-from-a-link – Thomas Cohn Jul 10 '18 at 21:04
  • Simply store it somewhere else. That's your only option. You can use any of the things you said you don't want to use, or any number of other possible similar alternatives. But they're all fundamentally the same: Store it somewhere else. – Kevin B Jul 10 '18 at 21:10
  • @helium I can’t change the url at all. There are too many variables in the url and it will cause confusion/won’t be accurate. – zazvorniki Jul 10 '18 at 21:11
  • @kevin, it’s not that I don’t “want” to use them it’s that I cannot use them. The app has built in cache busting between pages due to business requirements – zazvorniki Jul 10 '18 at 21:13
  • 1
    That is unfortunate, but it doesn't change the answer. – Kevin B Jul 10 '18 at 21:13
  • @chiliNUT no, I cannot set a cookie :( – zazvorniki Jul 10 '18 at 21:17
  • If the information is not there, there's no way to create it. Note that all the potential workarounds only work if the previous page is under your control. – Barmar Jul 10 '18 at 21:34

0 Answers0