• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

history.back() with object id page scroll

 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Most of you know that if you give an html object(an image for instance) an id value, you can use it in a link to load the page at that exact scroll position. for example:
<img id="thisImage" src="image.jpg">
<a href="thisPage.html#thisImage">Click me and you will scroll to the image</a>
---------------------------------------------
But I need the link to go back one page and to the top of that page.#top is a global id...no need to define it. So how do I write such a link?
This doesnt work:
<a href="javascript:history.back(1)#top">Go to the top of the last page you loaded</a>
 
reply
    Bookmark Topic Watch Topic
  • New Topic