In stackoverflow sites, if we hit the refresh button. It will automatically scrolls to the exact position where we were while hitting the refresh. I would like to know what is the name of this feature/technique.

We normally achieve this by appending #ref "ahref" to the url.

Using what technology it is implemented. Is it anything I can do with plain HTML?

  • Don't most sites do this be default on refresh? Although I'm sure some don't. – DaveShaw Aug 27 '10 at 20:28
  • 1
    It's a browser feature. Also what's the random "html5" tag for? – Matti Virkkunen Aug 27 '10 at 20:30
  • 1
    How does this belong on meta? It's asking about HTML technologies and not about how SO works. SO was just given as an example... – 0xA3 Aug 27 '10 at 20:35
  • @Matti Very recently, I noticed. So, I thought this could be one of HTML5's feature. – Avatar Aug 27 '10 at 20:55

This works on all websites, or at least just about all. I don't think this is a particular feature, the browser just does this to give you a better experience.

If this is not working on a site, you might want to check if there is anything still loading. Browsers usually wait until the entire page loads before scrolling you to where you were, and if you have a script or something else blocking the page from finishing loading, you might not be jumped back.

  • Oops! I didn't noticed this on other sites until reading this. My bad. – Avatar Aug 27 '10 at 20:50

As Brian said this is a feature of most browsers. However, you might experience problems when doing a post-back in ASP.NET. There used to be a feature called Smart Navigation to keep the scroll position. Maybe this is what you had in mind?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .