-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix browser back button! #496
Conversation
Cache AJAX responses in sessionStorage where available and restore on page load.
Nice work! Will merge it in ASAP. |
BTW there is new Google guidance on backbutton friendly inf scroll: http://googlewebmastercentral.blogspot.com/2014/02/infinite-scroll-search-friendly.html |
Hi, Is there any update on this pull request? I believe this should be a (very) high priority fix for this awesome plugin. This shouldn't be affected by the google guidelines since this fix leaves the html / server side code intact. The websites should still respond to |
@clockworkgeek could you rebase this PR so it's mergeable? |
It has been so long I forgot about this! I shall try to bring things up to date soon. |
My fork was itself forked by articulate and brought up to date. Would it be suitable to merge that instead? |
@clockworkgeek that sounds good to me. thanks again for the help! |
Any updates? There are a few workarounds out there like Scroll Frame: https://github.com/artsy/scroll-frame but I would really like to maintain my infiniteScroll setup. |
@Twansparant I'm also looking for the solution, I have tried scroll frame, but it is not working perfect on android device. |
Conflicts: jquery.infinitescroll.js jquery.infinitescroll.min.js merged with the current version of the master the fork here : metafizzy#496 and here
Closing this one because #622 has superseded it. |
Here is an experimental use of sessionStorage. Asynchronous content is cached temporarily (i.e. only until the browser tab or window is closed) and restored whenever infinite scroll is initialised, which is normally on page load. When using the back or forward buttons a browser typically attempts to restore the scroll position after page load, which means the content should have been restored by then. This fixes the biggest complaint of infinite scrolling.
This feature is graceful, it checks for the existence of sessionStorage rather than failing. For better compatibility you can use this sessionStorage shim.