0

I have a website (e.g. www.foo.com) and redirect to another (e.g. www.bar.com) via window.location. Unfortunately the website runs in fullscreen-mode (so no address bar available) and the user interacts with it by touch inputs (no keyboard, no mouse). Is it somehow possible to go back from www.bar.com to www.foo.com? Does jQuery do the trick?

UPDATE 1:

My problem is, that I dont have any access to www.bar.com. history.back(); works fine, but I cannot just add another button to the foreign website, can I?

To be more exact: I refer from my website to www.google.com. How can I go back from www.google.com to my website? If you advise me to use history.back() in the other website (e.g. here), please tell me how

I am very thankful

ArmandoS63
  • 693
  • 1
  • 6
  • 21
  • Can you store the location in a variable based on user events, and then simply navigate based on the location in the variable? – Amiga500 Sep 11 '17 at 14:43
  • Possible duplicate of [How to emulate browser back button using javascript](https://stackoverflow.com/questions/13490407/how-to-emulate-browser-back-button-using-javascript) – George Sep 11 '17 at 14:47

2 Answers2

2

did you try window.history.back(); ?

mbehzad
  • 3,758
  • 3
  • 22
  • 29
  • Yes, I did. The probelm is, I don't have any access to ´www.bar.com´. I think, I didn't ask clear enough, what my problem is – ArmandoS63 Sep 11 '17 at 14:49
  • well when user is on a new webpage, then i don't think there is any chance for the first page to do anything anymore. – mbehzad Sep 11 '17 at 14:50
0

I think you can do it with document.referrer It returns the URI of the page that linked to this page. w3c

dima bgood
  • 108
  • 1
  • 7