0

Maybe someone knows how to do such a function?

I need that every time then people goes back in my page they would get exaclty at the place where the link was, not in the top (beginnig) of a page. Facebook has such a function.

I know there is a links with anchor, but how to do this with a button back?

Thank you!

Kazik Jarmolovski
  • 211
  • 1
  • 3
  • 9

3 Answers3

0

Try this : mysite.com/mylink.html#anchor

mlishn
  • 1,689
  • 14
  • 19
  • Hmm.. My link looks like that: "http://www.site.com/index.php/directory/directory" And then I write it like this: "http://www.site.com/index.php/directory/directory#anchor" it doesnt even finds a page.. – Kazik Jarmolovski Jul 27 '12 at 15:16
  • how could it be site.com/index.php/........ There should be a ? to seperate the next /, do you have rewrite rules in place? – mlishn Jul 27 '12 at 15:20
  • I'm using Joomla, it change links stucture.. :) – Kazik Jarmolovski Jul 27 '12 at 15:28
0

Try this

Function is:

function GoBack(url){

window.open(url,'_self');

}

You can use it like this:

<input type="button" onclick="GoBack('YourUrl#Anc')" value="Go Back" />

Community
  • 1
  • 1
lilruchira
  • 123
  • 1
  • 1
  • 6
0

You can crate a cookie named [url of the page] that has the value of scrollpos at the moment with javascript when a user clicks a link. And when the page loads back again, you can fetch the cookie back and scroll to that position. Ugly but does the job..

Snow Blind
  • 1,164
  • 7
  • 12