Hacker News .hnnew | past | comments | ask | show | jobs | submitlogin

I really liked Discourse's approach to infinite scrolling[1], it updates the URL as you go with the History API's replaceState() function so you can safely navigate away from the page without losing your position.

[1]: http://eviltrout.com/2013/02/16/infinite-scrolling-that-work...



Also, visually, the up page# down could be shown on the right hand side. [http://try.discourse.org/t/discussion-happens-so-much/127/98] and with a bigger font. that's more clear. putting it in the bottom is hard to read.


If you look at the URL bar in google's example it does that as well.


The difference is that Discourse does it on a per-item basis, Google's on a per-page. A small implementation detail.


Well with discourse you want to go to a very specific comment in the thread so doing it per item is best. But that's not for every use case.


The difference is that it doesn't break the back button! Clicking back takes me back to HN, not back a page.


It's not without problems though. It breaks the incremental find in chrome. When the URL changes, the find dialog gets closed.


Wouldn't it be better to use anchors? It is the same page after all... now you'll end up with thousands of duplicit entries in your history.


Not quite, the replaceState() function, as its name would imply, replaces a history item instead of creating a new one.


Oh, I missed that it does that.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: