Recipe 13 | Extending Endless Pagination with pushState() |
Problem
One of the things that makes the Internet great is that, from news articles to cat GIFs, everyone can easily share links with one another. But with more applications using Ajax, this is no longer the case by default; clicking an Ajax link no longer guarantees that the browser’s URL is updated to reflect what the user is seeing. For many Ajax requests this is fine, but when large parts of the site change after a request, not keeping the URL up to date can cause issues. Not only does this prevent the sharing of links, but it breaks the back and refresh buttons.
Unfortunately, the endless-pagination code we wrote in Recipe 12, Displaying Information with Endless Pagination, has ...
Get Web Development Recipes, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.