This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes HTML, CSS and JavaScript and the fly likes How to get the Previous visited url name using java script Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "How to get the Previous visited url name using java script" Watch "How to get the Previous visited url name using java script" New topic
Author

How to get the Previous visited url name using java script

Vaidhi Bala
Greenhorn

Joined: Aug 03, 2006
Posts: 1
Hi All,

Please help me in getting the "previous visited url String" from the current page using java script.

for example, if I navigate from a.html to b.html. How to get the url a.html(Previous visited / last visited) from b.html.

Thanks in Advance,
Vaidhi
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61092
    
  66

There is no reliable means to do so. In some cases, the "Referer" header will be set, but there are many cases in which it will not.

Why do you want to do this? If it's for any type of decision making, there are better ways to do this.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to get the Previous visited url name using java script