Page back link

I use <a href="javascript: history.go(-1)">Back</a> script to return user on previous page and I have one problem. What if somebody came from google search on my product detail page and click back button,then the user will be returned on google page,does anyone know how to prevent that?

Why? If that’s what the user wants to do, that is their choice.
Browsers have a “back” button which does this anyway, so I don’t see the point.
If you do want to disable the back button on the landing page, you could use sessions to not show the button on the first page view of a session.

1 Like

I’m one of the anyones and I don’t know either. :stuck_out_tongue_winking_eye:

You could use javascript to detect if the http header refers to your site or to Google. But this is the HTML/CSS forum so I try it as such. :slight_smile:

I suggest the button links to that particular product’s overview page and says so in the tag. Because, as a visitor from a search result, that is what I would expect the button to do.

If I wanted to go back to the search result I would probably use the browser button or its shortcut.

Edit) Beaten to the punch by seconds. :blush:

Indicates that the user is meant to right click and save the following code as a bookmark to run against any web page. It is not supposed to be clicked on with the left mouse button.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.