Crazy website scrolling behavior



  • Imagine a webpage that is long enough that you have to scroll down to see it all.  So you scroll about half way and then you click a link.  You read that page and then you hit your back button.  You're now looking at the first web page and you expect your browser to have scrolled back to the same point you were at before you clicked the link.

     Still with me?  Well, some times I see a web page where, when you click the back button it always has you scrolled to the very top of the page.  Here's the latest example:

    http://orbithangar.com/top25.php

    resize your window if needed so that you have scrollbars.  Scroll to the bottom and click the last link.  Then click back and you'll be scrolled to the top of the page.

    There is some javascript on that page but I don't see anything that would cause it to scroll to the top.  What am I missing?
     



  • The page is served as "no cache". I could imagine, since the browser is not allowed to keep a local copy, it has to fetch it again when you use the back button, in the process "forgetting" the scrolling position.



  • ah, ok thanks.  Someone needs to make a FF pluging to cache no-cache pages.



  • That, and people should spend more time including intelligent caching behavoir in their scripts. It annoys me to no end when pages disable caching completely only because they end in .php and MIGHT be changing their content some time in this milennium... You can use header() for some more things than just redirecting, you know...



  • @PSWorx said:

    The page is served as "no cache". I could imagine, since the browser is not allowed to keep a local copy, it has to fetch it again when you use the back button, in the process "forgetting" the scrolling position.

     

    IIRC, displaying a cached copy of a no-cache page when the user hits the back button is specifically allowed by the standard... 



  • @tofu said:

    ah, ok thanks.  Someone needs to make a FF pluging to cache no-cache pages.


    Or just visit http://www.opera.com/download/



  • Re: website builder

    uniqueh...

     

    er, sorry, I guess my inner troll-feeder went through with me... please feel free do delete this post
     



  • @PSWorx said:

    uniqueh...

    Ranks up there with 'teh internets'


Log in to reply