Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to get the Previous visited url name using java script

 
Vaidhi Bala
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64830
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic