I need to make a link on various pages with 2 functions.
One that just act like browser-goback if vistor entered from a list-page.
And an ordinay linkfunction (where visitor will enter at the top) when reference page is any other than the list-page.
Have tried with this script
Expand|Select|Wrap|Line Numbers
- function mylist()
- { if(document.referrer === "list-page.htm"){
- history.back();
- } else {
- document.location = "list-page.htm"
- } }
Expand|Select|Wrap|Line Numbers
- <a href="javascript:void(0)" onClick="return mylist()"</a>