This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Javascript-- how to find referrer when url redirect is done Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Javascript-- how to find referrer when url redirect is done" Watch "Javascript-- how to find referrer when url redirect is done" New topic
Author

Javascript-- how to find referrer when url redirect is done

Vishal Sinha
Greenhorn

Joined: Jul 17, 2008
Posts: 6
Hi,
I have 3 jsp pages...
Page1 is part of application1.
Page1 contains a anchor element which points to page2. Page2 redirects to page3 which is a part of different application, lets say application 2.
(page2 does response.sendRedirect(page3) to redirect to the application2).

My question is how can I find out url of page 2 on page 3 using javascript. Please note that document.referrer in javascript gives url of page1. Also I want to run javascript code only on page3

Any help regarding it will be appreciated.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61310
    
  66

You cannot do this reliably.

Why do you need to know where you came from? Perhaps a better way can be suggested.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
GeeCON Prague 2014
 
subject: Javascript-- how to find referrer when url redirect is done