I'm currently upgrading my sub domains 404 error page and have added a link which take you back to the previous page which look like this:
Now my question is, Is it possible to check if the history length is 0? Which means the user can't go back (since there's no page to go back to) and therefor I want to remove this link in those cases.HTML Code:<a href="javascript: history.go(-1)">Go back to previous page</a>
If it's not possible in JavaScript is it possible to solve in another way?
I think you can try with js:
I'm not good in javascript, you can also use php:Code:if (document.referrer != '') // Go back
Bye!Code:if(!$_SERVER['HTTP_REFERER'])
// Go back
Oh, now I realize that this is actually another version of the same problem I had before with getting the last page. Thanks for the help.![]()
You're welcome!![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks