| Author |
How to get the url of previous page on click of browser back button
|
soni lal
Greenhorn
Joined: Jan 31, 2011
Posts: 25
|
|
Hi All,
I need to get the url from which the browser back button has been clicked
Suppose I am in page http://jchou.apple.com/kb/index?page=search&q=ipod&src=support_site.kbase.search.advanced having some href which is taking me to new page e.g http://jchou.apple.com/kb/HT1201
Now in page :http://jchou.apple.com/kb/HT1201 I clicked browser back button and came to previous page.
Here I have to get the information that from which page browser back button has been clicked.
I tried to use document.referrer but I didn't get the url of the page (where browser back button is clicked).
Please help me.
Thanks in advance.
|
 |
Robin John
Ranch Hand
Joined: Sep 10, 2008
Posts: 270
|
|
I assume that the webpages you have mentioned in questions are your applications pages ? and if not I assume they are just examples, and if examples then you have your own webpages in which you are trying to control the "back" button of the browser. If yes then look at the below link, it has a nice example on controling the browser back button. I tried it in IE and it works like a charm. But you have to test it for other browsers
WARNING - its messy.. and its not a good design to control any browser related functionality, avoid if you can
Link using javascript.-> webpage
you can modify the above code to show your browser's url like ->
|
Time is what we want the most, but what we use the worst. -- William Penn
|
 |
 |
|
|
subject: How to get the url of previous page on click of browser back button
|
|
|